Skip to content

Commit

Permalink
Add equals/hashcode to test data class to avoid direct runner warning…
Browse files Browse the repository at this point in the history
… log (apache#32883)
  • Loading branch information
scwhittle authored Nov 7, 2024
1 parent 3c8bb54 commit c7e4db7
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import org.apache.beam.sdk.coders.Coder;
import org.apache.beam.sdk.coders.KvCoder;
import org.apache.beam.sdk.coders.StringUtf8Coder;
Expand Down Expand Up @@ -226,5 +227,19 @@ public long getNum() {
public String getStr() {
return this.str;
}

@Override
public boolean equals(Object o) {
if (!(o instanceof Pojo)) {
return false;
}
Pojo pojo = (Pojo) o;
return num == pojo.num && Objects.equals(str, pojo.str);
}

@Override
public int hashCode() {
return Objects.hash(num, str);
}
}
}

0 comments on commit c7e4db7

Please sign in to comment.