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
  • Loading branch information
scwhittle committed Oct 23, 2024
1 parent 5d0dcfc commit 98209d1
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 98209d1

Please sign in to comment.