package hash;

public class Vehicle {
    int state; // key
    String id; // key
    String make;
    String model;
    int year;

    public Vehicle(int state, String id, String make, String model, int year) {
        super();
        this.state = state;
        this.id = id;
        this.make = make;
        this.model = model;
        this.year = year;
    }

    public boolean equals(Object obj) {
        if (obj instanceof Vehicle) {
            Vehicle other = (Vehicle) obj;
            return state == other.state && id.equals(other.id);
        } else {
            return false;
        }
    }

    public int hashCode() {
        return state + id.hashCode();
    }
}
