@Test public void testEquals() { RipInternalRoute r1 = new RipInternalRoute(Prefix.parse("1.1.1.1/32"), Ip.parse("2.2.2.2"), adminCost, 1, 1L); RipInternalRoute r1copy = new RipInternalRoute(Prefix.parse("1.1.1.1/32"), Ip.parse("2.2.2.2"), adminCost, 1, 1L); RipInternalRoute r2 = new RipInternalRoute(Prefix.parse("1.1.1.1/32"), Ip.parse("2.2.2.2"), adminCost, 2, 1L); RipInternalRoute r3 = new RipInternalRoute(Prefix.parse("1.1.1.1/32"), Ip.parse("2.2.2.2"), adminCost + 1, 1, 1L); RipInternalRoute r4 = new RipInternalRoute(Prefix.parse("1.1.1.1/32"), Ip.parse("2.2.2.3"), adminCost, 1, 1L); RipInternalRoute r5 = new RipInternalRoute(Prefix.parse("1.1.1.2/32"), Ip.parse("2.2.2.2"), adminCost, 2, 1L); assertThat(r1, equalTo(r1)); assertThat(r1, equalTo(r1copy)); assertThat(r1, not(equalTo(r2))); assertThat(r1, not(equalTo(r3))); assertThat(r1, not(equalTo(r4))); assertThat(r1, not(equalTo(r5))); assertThat(r1, not(equalTo(null))); assertThat(r1, not(equalTo(Prefix.parse("1.1.1.1/32")))); }
@Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof RipRoute)) { return false; } RipRoute other = (RipRoute) o; return _network.equals(other._network) && _admin == other._admin && _metric == other._metric && _nextHopIp.equals(other._nextHopIp) && getNonForwarding() == other.getNonForwarding() && getNonRouting() == other.getNonRouting() && _tag == other._tag; }
RipInternalRoute extends RipRoute { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof RipRoute)) { return false; } RipRoute other = (RipRoute) o; return _network.equals(other._network) && _admin == other._admin && _metric == other._metric && _nextHopIp.equals(other._nextHopIp) && getNonForwarding() == other.getNonForwarding() && getNonRouting() == other.getNonRouting() && _tag == other._tag; } }
RipInternalRoute extends RipRoute { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof RipRoute)) { return false; } RipRoute other = (RipRoute) o; return _network.equals(other._network) && _admin == other._admin && _metric == other._metric && _nextHopIp.equals(other._nextHopIp) && getNonForwarding() == other.getNonForwarding() && getNonRouting() == other.getNonRouting() && _tag == other._tag; } @JsonCreator  RipInternalRoute(
      @JsonProperty(PROP_NETWORK) Prefix network,
      @JsonProperty(PROP_NEXT_HOP_IP) Ip nextHopIp,
      @JsonProperty(PROP_ADMINISTRATIVE_COST) int admin,
      @JsonProperty(PROP_METRIC) long metric,
      @JsonProperty(PROP_TAG) long tag); }
RipInternalRoute extends RipRoute { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof RipRoute)) { return false; } RipRoute other = (RipRoute) o; return _network.equals(other._network) && _admin == other._admin && _metric == other._metric && _nextHopIp.equals(other._nextHopIp) && getNonForwarding() == other.getNonForwarding() && getNonRouting() == other.getNonRouting() && _tag == other._tag; } @JsonCreator  RipInternalRoute(
      @JsonProperty(PROP_NETWORK) Prefix network,
      @JsonProperty(PROP_NEXT_HOP_IP) Ip nextHopIp,
      @JsonProperty(PROP_ADMINISTRATIVE_COST) int admin,
      @JsonProperty(PROP_METRIC) long metric,
      @JsonProperty(PROP_TAG) long tag); @Nonnull @Override String getNextHopInterface(); @Override RoutingProtocol getProtocol(); static Builder builder(); @Override Builder toBuilder(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); }
RipInternalRoute extends RipRoute { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof RipRoute)) { return false; } RipRoute other = (RipRoute) o; return _network.equals(other._network) && _admin == other._admin && _metric == other._metric && _nextHopIp.equals(other._nextHopIp) && getNonForwarding() == other.getNonForwarding() && getNonRouting() == other.getNonRouting() && _tag == other._tag; } @JsonCreator  RipInternalRoute(
      @JsonProperty(PROP_NETWORK) Prefix network,
      @JsonProperty(PROP_NEXT_HOP_IP) Ip nextHopIp,
      @JsonProperty(PROP_ADMINISTRATIVE_COST) int admin,
      @JsonProperty(PROP_METRIC) long metric,
      @JsonProperty(PROP_TAG) long tag); @Nonnull @Override String getNextHopInterface(); @Override RoutingProtocol getProtocol(); static Builder builder(); @Override Builder toBuilder(); @Override boolean equals(@Nullable Object o); @Override int hashCode();  }