package J20250801.homework.demo01;

import java.util.Objects;

/**
 * @author WanJl
 * @version 1.0
 * @title Order
 * @description
 * @create 2025/8/1
 */
public class Order {
    private String type;
    private long createTime;

    public Order() {
    }

    public Order(String type) {
        this.type = type;
    }

    public Order(String type, long createTime) {
        this.type = type;
        this.createTime = createTime;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Order order = (Order) o;
        return createTime == order.createTime && Objects.equals(type, order.type);
    }

    @Override
    public int hashCode() {
        return Objects.hash(type, createTime);
    }

    @Override
    public String toString() {
        return "Order{" +
                "type='" + type + '\'' +
                ", createTime=" + createTime +
                '}';
    }
}
