package com.petshop.backend.dto.productsupplier;

import java.util.Objects;

public class ProductSupplierKey {
    private Long productId;
    private Long supplierId;

    public ProductSupplierKey() {
    }

    public ProductSupplierKey(Long productId, Long supplierId) {
        this.productId = productId;
        this.supplierId = supplierId;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public Long getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(Long supplierId) {
        this.supplierId = supplierId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ProductSupplierKey that = (ProductSupplierKey) o;
        return Objects.equals(productId, that.productId) && Objects.equals(supplierId, that.supplierId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(productId, supplierId);
    }

    @Override
    public String toString() {
        return "ProductSupplierKey{" +
                "productId=" + productId +
                ", supplierId=" + supplierId +
                '}';
    }
}

