/** * @author ZipCodeWilmington */ public class ActionResult { private T data; private String errorMessage; private ActionResult(T data) { this.data = data; } private ActionResult(String errorMessage) { this.errorMessage = errorMessage; } public T getData() { return data; } public String getErrorMessage() { return errorMessage; } public boolean isSuccess() { return data != null; } public static ActionResult success(E data) { return new ActionResult(data); } public static ActionResult fail(String errorMessage) { return new ActionResult(errorMessage); } }