@Test public void testEquals() { StaticRoute.Builder b = StaticRoute.builder().setNetwork(Prefix.parse("1.1.1.0/24")).setAdministrativeCost(1); new EqualsTester() .addEqualityGroup(b.build(), b.build()) .addEqualityGroup(b.setNetwork(Prefix.parse("2.2.2.0/24")).build()) .addEqualityGroup(b.setAdministrativeCost(2).build()) .addEqualityGroup(b.setNonRouting(true).build()) .addEqualityGroup(b.setNonForwarding(true).build()) .addEqualityGroup(b.setMetric(3).build()) .addEqualityGroup(b.setNextHopIp(Ip.parse("2.2.2.2")).build()) .addEqualityGroup(b.setNextHopInterface("Ethernet0").build()) .addEqualityGroup(b.setNextVrf("otherVrf").build()) .addEqualityGroup(b.setTag(4L).build()) .addEqualityGroup(new Object()) .testEquals(); }
@Override public boolean equals(@Nullable Object o) { if (o == this) { return true; } else if (!(o instanceof StaticRoute)) { return false; } StaticRoute rhs = (StaticRoute) o; return (_hashCode == rhs._hashCode || _hashCode == 0 || rhs._hashCode == 0) && _network.equals(rhs._network) && _admin == rhs._admin && getNonForwarding() == rhs.getNonForwarding() && getNonRouting() == rhs.getNonRouting() && _metric == rhs._metric && _nextHopInterface.equals(rhs._nextHopInterface) && _nextHopIp.equals(rhs._nextHopIp) && Objects.equals(_nextVrf, rhs._nextVrf) && _tag == rhs._tag; }
StaticRoute extends AbstractRoute implements Comparable<StaticRoute> { @Override public boolean equals(@Nullable Object o) { if (o == this) { return true; } else if (!(o instanceof StaticRoute)) { return false; } StaticRoute rhs = (StaticRoute) o; return (_hashCode == rhs._hashCode || _hashCode == 0 || rhs._hashCode == 0) && _network.equals(rhs._network) && _admin == rhs._admin && getNonForwarding() == rhs.getNonForwarding() && getNonRouting() == rhs.getNonRouting() && _metric == rhs._metric && _nextHopInterface.equals(rhs._nextHopInterface) && _nextHopIp.equals(rhs._nextHopIp) && Objects.equals(_nextVrf, rhs._nextVrf) && _tag == rhs._tag; } }
StaticRoute extends AbstractRoute implements Comparable<StaticRoute> { @Override public boolean equals(@Nullable Object o) { if (o == this) { return true; } else if (!(o instanceof StaticRoute)) { return false; } StaticRoute rhs = (StaticRoute) o; return (_hashCode == rhs._hashCode || _hashCode == 0 || rhs._hashCode == 0) && _network.equals(rhs._network) && _admin == rhs._admin && getNonForwarding() == rhs.getNonForwarding() && getNonRouting() == rhs.getNonRouting() && _metric == rhs._metric && _nextHopInterface.equals(rhs._nextHopInterface) && _nextHopIp.equals(rhs._nextHopIp) && Objects.equals(_nextVrf, rhs._nextVrf) && _tag == rhs._tag; } private  StaticRoute(
      @Nonnull Prefix network,
      @Nullable Ip nextHopIp,
      @Nullable String nextHopInterface,
      @Nullable String nextVrf,
      int administrativeCost,
      long metric,
      long tag,
      boolean nonForwarding,
      boolean nonRouting); }
StaticRoute extends AbstractRoute implements Comparable<StaticRoute> { @Override public boolean equals(@Nullable Object o) { if (o == this) { return true; } else if (!(o instanceof StaticRoute)) { return false; } StaticRoute rhs = (StaticRoute) o; return (_hashCode == rhs._hashCode || _hashCode == 0 || rhs._hashCode == 0) && _network.equals(rhs._network) && _admin == rhs._admin && getNonForwarding() == rhs.getNonForwarding() && getNonRouting() == rhs.getNonRouting() && _metric == rhs._metric && _nextHopInterface.equals(rhs._nextHopInterface) && _nextHopIp.equals(rhs._nextHopIp) && Objects.equals(_nextVrf, rhs._nextVrf) && _tag == rhs._tag; } private  StaticRoute(
      @Nonnull Prefix network,
      @Nullable Ip nextHopIp,
      @Nullable String nextHopInterface,
      @Nullable String nextVrf,
      int administrativeCost,
      long metric,
      long tag,
      boolean nonForwarding,
      boolean nonRouting); @Override @JsonIgnore(false) @JsonProperty(PROP_METRIC) Long getMetric(); @Nonnull @Override @JsonIgnore(false) @JsonProperty(PROP_NEXT_HOP_INTERFACE) String getNextHopInterface(); @Nonnull @JsonIgnore(false) @JsonProperty(PROP_NEXT_HOP_IP) @Override Ip getNextHopIp(); @Nullable @JsonProperty(PROP_NEXT_VRF) String getNextVrf(); @Override RoutingProtocol getProtocol(); static Builder builder(); @Override int compareTo(StaticRoute o); @Override Builder toBuilder(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); }
StaticRoute extends AbstractRoute implements Comparable<StaticRoute> { @Override public boolean equals(@Nullable Object o) { if (o == this) { return true; } else if (!(o instanceof StaticRoute)) { return false; } StaticRoute rhs = (StaticRoute) o; return (_hashCode == rhs._hashCode || _hashCode == 0 || rhs._hashCode == 0) && _network.equals(rhs._network) && _admin == rhs._admin && getNonForwarding() == rhs.getNonForwarding() && getNonRouting() == rhs.getNonRouting() && _metric == rhs._metric && _nextHopInterface.equals(rhs._nextHopInterface) && _nextHopIp.equals(rhs._nextHopIp) && Objects.equals(_nextVrf, rhs._nextVrf) && _tag == rhs._tag; } private  StaticRoute(
      @Nonnull Prefix network,
      @Nullable Ip nextHopIp,
      @Nullable String nextHopInterface,
      @Nullable String nextVrf,
      int administrativeCost,
      long metric,
      long tag,
      boolean nonForwarding,
      boolean nonRouting); @Override @JsonIgnore(false) @JsonProperty(PROP_METRIC) Long getMetric(); @Nonnull @Override @JsonIgnore(false) @JsonProperty(PROP_NEXT_HOP_INTERFACE) String getNextHopInterface(); @Nonnull @JsonIgnore(false) @JsonProperty(PROP_NEXT_HOP_IP) @Override Ip getNextHopIp(); @Nullable @JsonProperty(PROP_NEXT_VRF) String getNextVrf(); @Override RoutingProtocol getProtocol(); static Builder builder(); @Override int compareTo(StaticRoute o); @Override Builder toBuilder(); @Override boolean equals(@Nullable Object o); @Override int hashCode();  }