@Test public void testEquals() { AnswerMetadata.Builder builder = AnswerMetadata.builder().setStatus(AnswerStatus.SUCCESS); AnswerMetadata group1Elem1 = builder.build(); AnswerMetadata group1Elem2 = builder.build(); AnswerMetadata group1Elem3 = AnswerMetadata.forStatus(AnswerStatus.SUCCESS); AnswerMetadata group2Elem1 = builder.setMetrics(Metrics.builder().setNumRows(5).build()).build(); AnswerMetadata group3Elem1 = builder.setStatus(AnswerStatus.FAILURE).build(); new EqualsTester() .addEqualityGroup(group1Elem1, group1Elem2, group1Elem3) .addEqualityGroup(group2Elem1) .addEqualityGroup(group3Elem1) .testEquals(); }
@Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof AnswerMetadata)) { return false; } AnswerMetadata rhs = (AnswerMetadata) obj; return Objects.equals(_metrics, rhs._metrics) && _status == rhs._status; }
AnswerMetadata { @Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof AnswerMetadata)) { return false; } AnswerMetadata rhs = (AnswerMetadata) obj; return Objects.equals(_metrics, rhs._metrics) && _status == rhs._status; } }
AnswerMetadata { @Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof AnswerMetadata)) { return false; } AnswerMetadata rhs = (AnswerMetadata) obj; return Objects.equals(_metrics, rhs._metrics) && _status == rhs._status; } private  AnswerMetadata(@Nullable Metrics metrics, @Nonnull AnswerStatus status); }
AnswerMetadata { @Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof AnswerMetadata)) { return false; } AnswerMetadata rhs = (AnswerMetadata) obj; return Objects.equals(_metrics, rhs._metrics) && _status == rhs._status; } private  AnswerMetadata(@Nullable Metrics metrics, @Nonnull AnswerStatus status); static Builder builder(); static @Nonnull AnswerMetadata forStatus(AnswerStatus status); @Override boolean equals(@Nullable Object obj); @JsonProperty(BfConsts.PROP_METRICS) @Nullable Metrics getMetrics(); @JsonProperty(BfConsts.PROP_STATUS) @Nonnull AnswerStatus getStatus(); @Override int hashCode(); @Override String toString(); }
AnswerMetadata { @Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof AnswerMetadata)) { return false; } AnswerMetadata rhs = (AnswerMetadata) obj; return Objects.equals(_metrics, rhs._metrics) && _status == rhs._status; } private  AnswerMetadata(@Nullable Metrics metrics, @Nonnull AnswerStatus status); static Builder builder(); static @Nonnull AnswerMetadata forStatus(AnswerStatus status); @Override boolean equals(@Nullable Object obj); @JsonProperty(BfConsts.PROP_METRICS) @Nullable Metrics getMetrics(); @JsonProperty(BfConsts.PROP_STATUS) @Nonnull AnswerStatus getStatus(); @Override int hashCode(); @Override String toString();  }