package com.ruoyi.system.domain;

import java.util.Objects;

/**
 * @author Shawn
 */
public class WeekNumAndFromAndTo implements Comparable<WeekNumAndFromAndTo>{

    private String weekNum;

    private String from;

    private String to;

    public WeekNumAndFromAndTo() {
    }

    public WeekNumAndFromAndTo(String weekNum, String from, String to) {
        this.weekNum = weekNum;
        this.from = from;
        this.to = to;
    }

    public String getWeekNum() {
        return weekNum;
    }

    public void setWeekNum(String weekNum) {
        this.weekNum = weekNum;
    }

    public String getFrom() {
        return from;
    }

    public void setFrom(String from) {
        this.from = from;
    }

    public String getTo() {
        return to;
    }

    public void setTo(String to) {
        this.to = to;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        WeekNumAndFromAndTo that = (WeekNumAndFromAndTo) o;
        return Objects.equals(weekNum, that.weekNum) && Objects.equals(from, that.from) && Objects.equals(to, that.to);
    }

    @Override
    public int hashCode() {
        return Objects.hash(weekNum, from, to);
    }

    @Override
    public int compareTo(WeekNumAndFromAndTo o) {
        return Integer.parseInt(this.getWeekNum()) - Integer.parseInt(o.getWeekNum());
    }

}
