package org.loader.glin;

/**
 * Created by qibin on 2016/7/13.
 */

public class Result<T> {
    private boolean ok;
    private String message;
    private T result;
    private Object obj;

    public boolean isOK() {
        return ok;
    }

    public void ok(boolean ok) {
        this.ok = ok;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String mMessage) {
        this.message = mMessage;
    }

    public T getResult() {
        return result;
    }

    public void setResult(T mResult) {
        this.result = mResult;
    }

    public boolean isOk() {
        return ok;
    }

    public void setOk(boolean ok) {
        this.ok = ok;
    }

    public Object getObj() {
        return obj;
    }

    public void setObj(Object obj) {
        this.obj = obj;
    }

    public <V> V assertGetObj() {
        return (V) getObj();
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("ok: ").append(ok).append("\n");
        sb.append("message: ").append(message).append("\n");
        sb.append("obj: ").append(obj).append("\n");
        sb.append("result: ").append(result);

        return sb.toString();
    }
}

@@ -184,16 +184,45 @@
 ect obj;
+%0A    private boolean isCache;
 %0A%0A    pu
@@ -924,24 +924,160 @@
 j();%0A    %7D%0A%0A
+    public boolean isCache() %7B%0A        return isCache;%0A    %7D%0A%0A    public void setCache(boolean cache) %7B%0A        isCache = cache;%0A    %7D%0A%0A
     @Overrid
@@ -1367,16 +1367,65 @@
 result);
+%0A        sb.append(%22is_cache: %22).append(isCache);
 %0A%0A      

add Result.isCache