@Test public void testEquals() { KernelRoute.Builder builder = KernelRoute.builder(); KernelRoute kr = builder.setNetwork(Prefix.strict("10.0.0.0/24")).build(); new EqualsTester() .addEqualityGroup(kr, kr, builder.build()) .addEqualityGroup(builder.setNetwork(Prefix.ZERO).build()) .addEqualityGroup((builder.setTag(5L).build())) .testEquals(); }
@Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof KernelRoute)) { return false; } KernelRoute rhs = (KernelRoute) o; return _network.equals(rhs._network) && _tag == rhs._tag; }
KernelRoute extends AbstractRoute implements Comparable<KernelRoute> { @Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof KernelRoute)) { return false; } KernelRoute rhs = (KernelRoute) o; return _network.equals(rhs._network) && _tag == rhs._tag; } }
KernelRoute extends AbstractRoute implements Comparable<KernelRoute> { @Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof KernelRoute)) { return false; } KernelRoute rhs = (KernelRoute) o; return _network.equals(rhs._network) && _tag == rhs._tag; } KernelRoute(Prefix network);  KernelRoute(Prefix network, long tag); }
KernelRoute extends AbstractRoute implements Comparable<KernelRoute> { @Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof KernelRoute)) { return false; } KernelRoute rhs = (KernelRoute) o; return _network.equals(rhs._network) && _tag == rhs._tag; } KernelRoute(Prefix network);  KernelRoute(Prefix network, long tag); static Builder builder(); @Override int compareTo(KernelRoute o); @Override Long getMetric(); @JsonProperty(PROP_NEXT_HOP_INTERFACE) @Nonnull @Override String getNextHopInterface(); @Nonnull @Override Ip getNextHopIp(); @Override RoutingProtocol getProtocol(); @Override Builder toBuilder(); @Override boolean equals(Object o); @Override int hashCode(); }
KernelRoute extends AbstractRoute implements Comparable<KernelRoute> { @Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof KernelRoute)) { return false; } KernelRoute rhs = (KernelRoute) o; return _network.equals(rhs._network) && _tag == rhs._tag; } KernelRoute(Prefix network);  KernelRoute(Prefix network, long tag); static Builder builder(); @Override int compareTo(KernelRoute o); @Override Long getMetric(); @JsonProperty(PROP_NEXT_HOP_INTERFACE) @Nonnull @Override String getNextHopInterface(); @Nonnull @Override Ip getNextHopIp(); @Override RoutingProtocol getProtocol(); @Override Builder toBuilder(); @Override boolean equals(Object o); @Override int hashCode();  }