package de.votian.services.entity;

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

public class ServiceZipCodeNeighbourId implements Serializable {

    private Long headquartersId;
    private Long zipCodeId;
    private Long neighbourZipCodeId;

    public ServiceZipCodeNeighbourId() {
    }

    public ServiceZipCodeNeighbourId(Long headquartersId, Long zipCodeId, Long neighbourZipCodeId) {
        this.headquartersId = headquartersId;
        this.zipCodeId = zipCodeId;
        this.neighbourZipCodeId = neighbourZipCodeId;
    }

    @Override
    public boolean equals(Object other) {
        if (this == other) {
            return true;
        }
        if (!(other instanceof ServiceZipCodeNeighbourId that)) {
            return false;
        }
        return Objects.equals(headquartersId, that.headquartersId)
                && Objects.equals(zipCodeId, that.zipCodeId)
                && Objects.equals(neighbourZipCodeId, that.neighbourZipCodeId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(headquartersId, zipCodeId, neighbourZipCodeId);
    }
}
