package cn.com.qmth.stmms.biz.utils;

import org.apache.commons.lang.StringUtils;

public class TaskEntry {

    private int markerId;

    private String taskId;

    private long timestamp;

    public TaskEntry(int markerId, String taskId) {
        this.markerId = markerId;
        this.taskId = taskId;
        this.timestamp = System.currentTimeMillis();
    }

    @Override
    public int hashCode() {
        return taskId.hashCode();
    }

    @Override
    public String toString() {
        return markerId + "-" + taskId;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj != null && obj instanceof TaskEntry) {
            TaskEntry mt = (TaskEntry) obj;
            return StringUtils.equals(mt.taskId, this.taskId);
        } else {
            return false;
        }
    }

    public int getMarkerId() {
        return markerId;
    }

    public String getTaskId() {
        return taskId;
    }

    public long getTimestamp() {
        return timestamp;
    }
}
