package com.diagbot.dto;
import java.io.Serializable;
/**
 * 数据服务接口
 * 返回结果实体类
 * @version 0.0.1
 * @author wangfeng
 * @since  2018-09-19
 */
public final class ResultModelDTO implements Serializable {
    private static final long serialVersionUID = 1L;
    public static final ResultModelDTO resultModel = new ResultModelDTO(true);
	/**true表示处理成功**/
	private boolean result;
	/**消息体**/
	private String message;
    /**返回结果**/
	private Object data;
	/**扩展数据**/
	private Object extendData;

	/**
	 * 构造
	 * @param boolean
	 * @return ResultModel
	 */
    public ResultModelDTO(final boolean success){
        this(success,null,null,null);
    }
    /**
	 * 构造
	 * @return ResultModel
	 */
	public ResultModelDTO() {
        super();
    }
	/**
	 * 构造
	 * @param success
	 * @param msg
	 * @param data
	 * @param extendData
	 * @return ResultModel
	 */
    public ResultModelDTO(final boolean success, final String msg,final Object data,final Object extendData) {
        super();
        this.result = success;
        this.message = msg;
        this.data = data;
        this.extendData = extendData;
    }
     /**
      * createSuccess 方法
      * @param msg
      * @param data
      * @param extendData
      * @return ResultModel
      */
	public static ResultModelDTO createSuccess(final String msg,final Object data,final Object extendData){
	    return new ResultModelDTO(true,msg,data,extendData);
	}
	/**
	 * create 方法
	 * @param success
	 * @param msg
	 * @param data
	 * @param extendData
	 * @return ResultModel
	 */
    public static ResultModelDTO create(final boolean success, final String msg,final Object data,final Object extendData){
        return new ResultModelDTO(success,msg,data,extendData);
    }
    /**
     * create 方法
     * @param success
     * @param msg
     * @param data
     * @return create
     */
    public static ResultModelDTO create(final boolean success, final String msg,final Object data){
        return new ResultModelDTO(success,msg,data,null);
    }

	public boolean isResult() {
		return result;
	}

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

	public String getMessage() {
		return message;
	}

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

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public Object getExtendData() {
		return extendData;
	}

	public void setExtendData(Object extendData) {
		this.extendData = extendData;
	}
}
