first commit

This commit is contained in:
jeffcheasey88
2023-10-01 11:45:56 +02:00
commit ddddcadb24
13 changed files with 418 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
package be.jeffcheasey88.todo.model;
import dev.peerat.framework.utils.json.JsonMap;
public class Result<E>{
private E element;
private int errorCode;
private JsonMap error;
public Result(E element){
this.element = element;
}
public Result(int errorCode, JsonMap error){
this.errorCode = errorCode;
this.error = error;
}
public boolean success(){
return error == null;
}
public E getElement(){
return this.element;
}
public int getErrorCode(){
return this.errorCode;
}
public JsonMap getError(){
return this.error;
}
}