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

com.rt.logic.beans.EncryptionBean Maven / Gradle / Ivy

There is a newer version: 1.1.17
Show newest version
package com.rt.logic.beans;

import com.rt.core.beans.Property;

import java.io.Serializable;
import java.util.Map;

/**
 * json对象加密对象
 *
 * @author msc
 */
public class EncryptionBean extends Property {

    /**
     * 默认构造函数
     */
    public EncryptionBean() {
        super();
    }

    /**
     * 通过json字符串构造
     *
     * @param string json string
     * @throws Exception json format exception
     */
    public EncryptionBean(String string) throws Exception {
        super(string);
    }

    /**
     * 通过Map构造
     *
     * @param map Serializable map
     */
    public EncryptionBean(Map map) {
        super(map);
    }

    /**
     * 构造函数
     *
     * @param success success
     * @param code    message code
     * @param message message
     * @param data    data
     */
    public EncryptionBean(boolean success, String code, String message, Serializable data) {
        setSuccess(success);
        setCode(code);
        setMessage(message);
        setData(data);
    }

    /**
     * 构造函数
     *
     * @param success success
     * @param code    message code
     * @param message message
     */
    public EncryptionBean(boolean success, String code, String message) {
        this(success, code, message, null);
    }

    /**
     * 应用ID
     *
     * @return String
     */
    public String getAppId() {
        return getString("appId");
    }

    /**
     * 应用ID
     *
     * @param appId appId
     */
    public void setAppId(String appId) {
        put("appId", appId);
    }

    /**
     * 业务逻辑名称
     *
     * @return String
     */
    public String getLogicId() {
        return getString("logicId");
    }

    /**
     * 业务逻辑名称
     *
     * @param logicId logic id
     */
    public void setLogicId(String logicId) {
        put("logicId", logicId);
    }

    /**
     * 业务追踪ID
     *
     * @return String
     */
    public String getTraceId() {
        return getString("traceId");
    }

    /**
     * 业务追踪ID
     *
     * @param traceId traceId
     */
    public void setTraceId(String traceId) {
        put("traceId", traceId);
    }

    /**
     * 获取签名
     *
     * @return String
     */
    public String getSign() {
        return getString("sign");
    }

    /**
     * 设置签名
     *
     * @param sign sign
     */
    public void setSign(String sign) {
        put("sign", sign);
    }

    /**
     * 消息
     *
     * @return String
     */
    public String getMessage() {
        return getString("message");
    }

    /**
     * 消息
     *
     * @param message message value
     */
    public void setMessage(String message) {
        put("message", message);
    }

    /**
     * 是否设置了成功或失败
     *
     * @return boolean
     */
    public boolean hasSuccess() {
        return has("success");
    }

    /**
     * 执行成功或失败
     *
     * @return String
     */
    public boolean isSuccess() {
        return getBoolean("success");
    }

    /**
     * 消息
     *
     * @param success is success boolean tag
     */
    public void setSuccess(boolean success) {
        put("success", success);
    }

    /**
     * 获取data数据
     *
     * @param  object
     * @return T object
     */
    public  T getData() {
        return (T) get("data");
    }

    /**
     * 数据
     *
     * @param data the data to set
     */
    public void setData(Object data) {
        put("data", data);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy