We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cd8fdbe commit 95f3dd1Copy full SHA for 95f3dd1
src/main/java/br/com/zevolution/algorithms/sorting/Product.java
@@ -19,4 +19,22 @@ public String toString() {
19
return this.description;
20
}
21
22
-}
+ @Override
23
+ public boolean equals(Object obj) {
24
+ if (obj == null)
25
+ return false;
26
+
27
+ if (this.getClass() != obj.getClass())
28
29
30
+ Product other = Product.class.cast(obj);
31
+ return other.toString().equals(this.toString()) &&
32
+ other.getPrice() == this.getPrice();
33
+ }
34
35
36
+ public int hashCode() {
37
+ return super.hashCode();
38
39
40
+}
0 commit comments