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

com.soento.core.lang.Response Maven / Gradle / Ivy

package com.soento.core.lang;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.soento.core.consts.BaseCode;

/**
 * @author yantao.zeng
 */
public class Response extends BaseObject {
    private static final long serialVersionUID = -8301806726034267451L;
    private String code;
    private String message;
    private T data;

    @JsonIgnore
    public boolean isSuccess() {
        return BaseCode.SUCCESS.equals(code);
    }

    @JsonIgnore
    public boolean isPending() {
        return BaseCode.PENDING.equals(code);
    }

    public String getCode() {
        return code;
    }

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

    public String getMessage() {
        return message;
    }

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

    public T getData() {
        return data;
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy