package cn.edu.whu.boot.allocation.entities;

import java.io.Serializable;
import java.util.Objects;

public class TaskUserCell implements Serializable{

    private static final long serialVersionUID = -1326635728899511955L;

    private Integer id;

    private Integer taskId;

    private Integer userId;

    private String cellGeohash;

    public TaskUserCell() {
    }

    public TaskUserCell(Integer taskId, Integer userId, String cellGeohash) {
        this.taskId = taskId;
        this.userId = userId;
        this.cellGeohash = cellGeohash;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getTaskId() {
        return taskId;
    }

    public void setTaskId(Integer taskId) {
        this.taskId = taskId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getCellGeohash() {
        return cellGeohash;
    }

    public void setCellGeohash(String cellGeohash) {
        this.cellGeohash = cellGeohash;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TaskUserCell that = (TaskUserCell) o;
        return taskId.equals(that.taskId) && userId.equals(that.userId) && cellGeohash.equals(that.cellGeohash);
    }

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