| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- package com.goafanti.common.bo;
- import java.io.Serializable;
- import java.util.ArrayList;
- import java.util.List;
- public class Result {
- private Object data;
- private List<Error> error = new ArrayList<Error>();
- private Serializable token;
- public Result() {
- /*if(TokenManager.isLogin())
- this.token = SecurityUtils.getSubject().getSession().getId();*/
- }
- public Result(Object data) {
- this.data = data;
- }
- /**
- * @return the data
- */
- public Object getData() {
- return data;
- }
- /**
- * @param data
- * the data to set
- */
- public void setData(Object data) {
- this.data = data;
- }
- /**
- * @return the error
- */
- public List<Error> getError() {
- return error;
- }
- /**
- * @param error
- * the error to set
- */
- public void setError(List<Error> error) {
- this.error = error;
- }
- public Result error(Error e) {
- if (e != null) {
- this.error.add(e);
- }
- return this;
- }
- public Result data(Object o) {
- this.data = o;
- return this;
- }
- public Serializable getToken() {
- return token;
- }
- public void setToken(Serializable token) {
- this.token = token;
- }
- }
|