mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-04 09:11:39 +00:00
feature: easier to test
This commit is contained in:
parent
cf30879171
commit
981180fdb0
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user