xinyuiscool commented on a change in pull request #1138: SAMZA-2302: Add 
equals, hashcode and toString to KV
URL: https://github.com/apache/samza/pull/1138#discussion_r314104058
 
 

 ##########
 File path: samza-api/src/main/java/org/apache/samza/operators/KV.java
 ##########
 @@ -45,4 +49,30 @@ public K getKey() {
   public V getValue() {
     return value;
   }
+
+  @Override
+  public boolean equals(Object other) {
+    if (this == other) {
+      return true;
+    }
+    if (!(other instanceof KV)) {
+      return false;
+    }
+    KV<?, ?> otherKv = (KV<?, ?>) other;
+    return Objects.deepEquals(this.key, otherKv.key)
 
 Review comment:
   Objects.deepEquals takes care of null checks.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to