package com.zy.asrs.task.core; 
 | 
  
 | 
import java.io.Serializable; 
 | 
  
 | 
/** 
 | 
 * Created by vincent on 2020/7/7 
 | 
 */ 
 | 
public class ReturnT<T> implements Serializable { 
 | 
  
 | 
    public static final long serialVersionUID = 42L; 
 | 
    public static final int SUCCESS_CODE = 200; 
 | 
    public static final int FAIL_CODE = 500; 
 | 
    private int code; 
 | 
    private String msg; 
 | 
    private T content; 
 | 
  
 | 
    public ReturnT() { 
 | 
    } 
 | 
  
 | 
    public ReturnT(int code, String msg) { 
 | 
        this.code = code; 
 | 
        this.msg = msg; 
 | 
    } 
 | 
  
 | 
    public ReturnT(T content) { 
 | 
        this.code = 200; 
 | 
        this.content = content; 
 | 
    } 
 | 
  
 | 
    public boolean isSuccess(){ 
 | 
        return this.code == 200; 
 | 
    } 
 | 
  
 | 
    public int getCode() { 
 | 
        return this.code; 
 | 
    } 
 | 
  
 | 
    public ReturnT<T> setCode(int code) { 
 | 
        this.code = code; 
 | 
        return this; 
 | 
    } 
 | 
  
 | 
    public String getMsg() { 
 | 
        return this.msg; 
 | 
    } 
 | 
  
 | 
    public ReturnT<T> setMsg(String msg) { 
 | 
        this.msg = msg; 
 | 
        return this; 
 | 
    } 
 | 
  
 | 
    public T getContent() { 
 | 
        return this.content; 
 | 
    } 
 | 
  
 | 
    public ReturnT<T> setContent(T content) { 
 | 
        this.content = content; 
 | 
        return this; 
 | 
    } 
 | 
  
 | 
    public String toString() { 
 | 
        return "ReturnT [code=" + this.code + ", msg=" + this.msg + ", content=" + this.content + "]"; 
 | 
    } 
 | 
  
 | 
} 
 |