package com.gyee.runeconomy.model;

import java.io.Serializable;

/**
 * 标签信息
 *
 * @author xysn
 */
public class TagInfo implements Serializable {
    /**
     * 标签点
     */
    private String tag;
    /**
     * 值
     */
    private double value;
    /**
     * 时间戳
     */
    private long timestamp;
    /**
     * 数据改变监听
     */
    private ITagValueChanged valueChanged;

    public TagInfo() {
    }

    public TagInfo(double value) {
        this.value = value;
    }

    public TagInfo(String tag) {
        this.tag = tag;
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public double getValue() {
        return value;
    }

    public void setValue(double value) {
        this.value = value;
        if (this.valueChanged != null) {
            this.valueChanged.valueChanged(value);
        }
    }

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    public void setValueChanged(ITagValueChanged valueChanged) {
        this.valueChanged = valueChanged;
    }
}
