feature: easier to test

This commit is contained in:
Kadir Sirimsi 2025-02-10 15:21:41 +01:00
parent cf30879171
commit 981180fdb0
No known key found for this signature in database
GPG Key ID: A21C0144C2D2A134

View File

@ -84,4 +84,16 @@ public class Item {
public String toString() {
return this.name + ", " + this.sellIn + ", " + this.quality;
}
@Override
public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) return false;
Item item = (Item) o;
return sellIn == item.sellIn && quality == item.quality && Objects.equals(name, item.name) && type == item.type;
}
@Override
public int hashCode() {
return Objects.hash(name, type, sellIn, quality);
}
}