@Test public void testEquals() { OspfAreaSummary summary = new OspfAreaSummary(true, 100L); new EqualsTester() .addEqualityGroup(summary, summary, new OspfAreaSummary(true, 100L)) .addEqualityGroup(new OspfAreaSummary(false, 100L)) .addEqualityGroup(new OspfAreaSummary(true, 200L)) .addEqualityGroup(new Object()) .testEquals(); }
@Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof OspfAreaSummary)) { return false; } OspfAreaSummary that = (OspfAreaSummary) o; return getAdvertised() == that.getAdvertised() && Objects.equals(getMetric(), that.getMetric()); }
OspfAreaSummary implements Serializable { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof OspfAreaSummary)) { return false; } OspfAreaSummary that = (OspfAreaSummary) o; return getAdvertised() == that.getAdvertised() && Objects.equals(getMetric(), that.getMetric()); } }
OspfAreaSummary implements Serializable { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof OspfAreaSummary)) { return false; } OspfAreaSummary that = (OspfAreaSummary) o; return getAdvertised() == that.getAdvertised() && Objects.equals(getMetric(), that.getMetric()); } OspfAreaSummary(boolean advertised, @Nullable Long metric); }
OspfAreaSummary implements Serializable { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof OspfAreaSummary)) { return false; } OspfAreaSummary that = (OspfAreaSummary) o; return getAdvertised() == that.getAdvertised() && Objects.equals(getMetric(), that.getMetric()); } OspfAreaSummary(boolean advertised, @Nullable Long metric); @JsonProperty(PROP_ADVERTISE) boolean getAdvertised(); @Nullable @JsonProperty(PROP_METRIC) Long getMetric(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); }
OspfAreaSummary implements Serializable { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof OspfAreaSummary)) { return false; } OspfAreaSummary that = (OspfAreaSummary) o; return getAdvertised() == that.getAdvertised() && Objects.equals(getMetric(), that.getMetric()); } OspfAreaSummary(boolean advertised, @Nullable Long metric); @JsonProperty(PROP_ADVERTISE) boolean getAdvertised(); @Nullable @JsonProperty(PROP_METRIC) Long getMetric(); @Override boolean equals(@Nullable Object o); @Override int hashCode();  }