@Test public void testEquals() { LocalRoute.Builder lr = LocalRoute.builder() .setNetwork(Prefix.parse("1.1.1.1/32")) .setSourcePrefixLength(24) .setNextHopInterface("Ethernet0"); new EqualsTester() .addEqualityGroup( new LocalRoute(ConcreteInterfaceAddress.parse("1.1.1.1/24"), "Ethernet0"), lr.build(), lr.setNonRouting(true).build(), lr.setNonForwarding(false).build()) .addEqualityGroup(new LocalRoute(ConcreteInterfaceAddress.parse("1.1.2.1/24"), "Ethernet0")) .addEqualityGroup( new LocalRoute(ConcreteInterfaceAddress.parse("1.1.2.1/24"), "Ethernet1"), new LocalRoute(Prefix.parse("1.1.2.1/32"), "Ethernet1", 24, 0, Route.UNSET_ROUTE_TAG)) .addEqualityGroup( new LocalRoute(Prefix.parse("1.1.2.1/32"), "Ethernet1", 24, 123, Route.UNSET_ROUTE_TAG)) .addEqualityGroup( new LocalRoute(Prefix.parse("1.1.2.1/32"), "Ethernet1", 25, 123, Route.UNSET_ROUTE_TAG)) .addEqualityGroup(new LocalRoute(Prefix.parse("1.1.2.1/32"), "Ethernet1", 25, 123, 1L)) .addEqualityGroup(new Object()) .testEquals(); }
@Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof LocalRoute)) { return false; } LocalRoute rhs = (LocalRoute) o; return _network.equals(rhs._network) && _admin == rhs._admin && getNonRouting() == rhs.getNonRouting() && getNonForwarding() == rhs.getNonForwarding() && _nextHopInterface.equals(rhs._nextHopInterface) && _sourcePrefixLength == rhs._sourcePrefixLength && _tag == rhs._tag; }
LocalRoute extends AbstractRoute { @Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof LocalRoute)) { return false; } LocalRoute rhs = (LocalRoute) o; return _network.equals(rhs._network) && _admin == rhs._admin && getNonRouting() == rhs.getNonRouting() && getNonForwarding() == rhs.getNonForwarding() && _nextHopInterface.equals(rhs._nextHopInterface) && _sourcePrefixLength == rhs._sourcePrefixLength && _tag == rhs._tag; } }
LocalRoute extends AbstractRoute { @Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof LocalRoute)) { return false; } LocalRoute rhs = (LocalRoute) o; return _network.equals(rhs._network) && _admin == rhs._admin && getNonRouting() == rhs.getNonRouting() && getNonForwarding() == rhs.getNonForwarding() && _nextHopInterface.equals(rhs._nextHopInterface) && _sourcePrefixLength == rhs._sourcePrefixLength && _tag == rhs._tag; } LocalRoute(ConcreteInterfaceAddress interfaceAddress, String nextHopInterface); @VisibleForTesting  LocalRoute(Prefix network, String nextHopInterface, int sourcePrefixLength, int admin, long tag); }
LocalRoute extends AbstractRoute { @Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof LocalRoute)) { return false; } LocalRoute rhs = (LocalRoute) o; return _network.equals(rhs._network) && _admin == rhs._admin && getNonRouting() == rhs.getNonRouting() && getNonForwarding() == rhs.getNonForwarding() && _nextHopInterface.equals(rhs._nextHopInterface) && _sourcePrefixLength == rhs._sourcePrefixLength && _tag == rhs._tag; } LocalRoute(ConcreteInterfaceAddress interfaceAddress, String nextHopInterface); @VisibleForTesting  LocalRoute(Prefix network, String nextHopInterface, int sourcePrefixLength, int admin, long tag); @Override Long getMetric(); @Nonnull @JsonIgnore(false) @JsonProperty(PROP_NEXT_HOP_INTERFACE) @Override String getNextHopInterface(); @Nonnull @Override Ip getNextHopIp(); @Override RoutingProtocol getProtocol(); @JsonProperty(PROP_SOURCE_PREFIX_LENGTH) int getSourcePrefixLength(); static Builder builder(); @Override AbstractRouteBuilder<Builder, LocalRoute> toBuilder(); @Override boolean equals(Object o); @Override int hashCode(); }
LocalRoute extends AbstractRoute { @Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof LocalRoute)) { return false; } LocalRoute rhs = (LocalRoute) o; return _network.equals(rhs._network) && _admin == rhs._admin && getNonRouting() == rhs.getNonRouting() && getNonForwarding() == rhs.getNonForwarding() && _nextHopInterface.equals(rhs._nextHopInterface) && _sourcePrefixLength == rhs._sourcePrefixLength && _tag == rhs._tag; } LocalRoute(ConcreteInterfaceAddress interfaceAddress, String nextHopInterface); @VisibleForTesting  LocalRoute(Prefix network, String nextHopInterface, int sourcePrefixLength, int admin, long tag); @Override Long getMetric(); @Nonnull @JsonIgnore(false) @JsonProperty(PROP_NEXT_HOP_INTERFACE) @Override String getNextHopInterface(); @Nonnull @Override Ip getNextHopIp(); @Override RoutingProtocol getProtocol(); @JsonProperty(PROP_SOURCE_PREFIX_LENGTH) int getSourcePrefixLength(); static Builder builder(); @Override AbstractRouteBuilder<Builder, LocalRoute> toBuilder(); @Override boolean equals(Object o); @Override int hashCode();  }