All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.payermax.sdk.domain.GatewayResult Maven / Gradle / Ivy

There is a newer version: 1.0.12
Show newest version
package com.payermax.sdk.domain;

import java.io.Serializable;

/**
 * @author zhu.q
 */
public class GatewayResult implements Serializable {
    public static final String APPLY_SUCCESS = "APPLY_SUCCESS";
    private String code;
    private String msg;
    private T data;

    public GatewayResult() {
    }

    public GatewayResult(T data) {
        this.data = data;
    }

    public GatewayResult(String msg, String code) {
        this.msg = msg;
        this.code = code;
    }

    public GatewayResult(T data, String msg, String code) {
        this.msg = msg;
        this.code = code;
        this.data = data;
    }

    public T getData() {
        return this.data;
    }

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

    public String getCode() {
        return this.code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return this.msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public GatewayResult mapper(GatewayResult biz) {
        this.setCode(biz.getCode());
        this.setMsg(biz.getMsg());
        return this;
    }

    public boolean isSuccess() {
        return APPLY_SUCCESS.equals(this.code);
    }

    @Override
    public String toString() {
        return "Result{code='" + this.code + '\'' + ", msg='" + this.msg + '\'' + ", data=" + this.data + '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy