package com.javadevjournal.data;

import java.util.Objects;

public class Product {

    private String code;
    private String name;
    private String description;

    public Product(String code, String name, String description) {
        this.code = code;
        this.name = name;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Product)) return false;
        Product product = (Product) o;
        return Objects.equals(getCode(), product.getCode());
    }

    @Override
    public int hashCode() {

        return Objects.hash(getCode());
    }
}
