package com.mvc.iot.onenet.model;

import com.mvc.utils.NumberUtil;
import org.apache.pulsar.shade.org.apache.commons.codec.binary.Base64;

import java.io.Serializable;

/**
 * 数据流-数据点(dataPoints)Value对象
 */
public class OneNetDataPointsValueModel implements Serializable {
    private String data;
    private Integer type;

    public String getData() {
        return data;
    }

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

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    /**
     * 获取原始数据(BASE64解码后)
     * @return
     */
    public String getOriginalData(){
        return NumberUtil.bytesToHexStr(Base64.decodeBase64(data));
    }
}
