package org.springblade.common.utils;

import java.util.Date;
import java.util.Objects;

public class MonitorTask {
    private final String taskId;
    private final Date requestTime;

    public MonitorTask(String taskId) {
        this.taskId = taskId;
        this.requestTime = new Date();
    }

    public String getTaskId() {
        return taskId;
    }

    public Date getRequestTime() {
        return requestTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MonitorTask that = (MonitorTask) o;
        return Objects.equals(taskId, that.taskId);
    }

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