@Test public void testEquals() { Builder brb = Bgpv4Route.builder() .setNetwork(Prefix.parse("1.1.1.0/24")) .setOriginatorIp(Ip.parse("1.1.1.1")) .setOriginType(OriginType.IGP) .setProtocol(RoutingProtocol.BGP); new EqualsTester() .addEqualityGroup(brb.build(), brb.build()) .addEqualityGroup(brb.setNetwork(Prefix.parse("1.1.2.0/24")).build()) .addEqualityGroup(brb.setAdmin(10).build()) .addEqualityGroup(brb.setNonRouting(true).build()) .addEqualityGroup(brb.setNonForwarding(true).build()) .addEqualityGroup(brb.setAsPath(AsPath.ofSingletonAsSets(1L, 1L)).build()) .addEqualityGroup(brb.setClusterList(ImmutableSet.of(1L)).build()) .addEqualityGroup(brb.setCommunities(ImmutableSet.of(StandardCommunity.of(1L))).build()) .addEqualityGroup(brb.setDiscard(true).build()) .addEqualityGroup(brb.setLocalPreference(10).build()) .addEqualityGroup(brb.setMetric(10).build()) .addEqualityGroup(brb.setNextHopInterface("blah").build()) .addEqualityGroup(brb.setNextHopIp(Ip.parse("2.2.2.2")).build()) .addEqualityGroup(brb.setOriginatorIp(Ip.parse("2.2.2.2")).build()) .addEqualityGroup(brb.setOriginType(OriginType.INCOMPLETE).build()) .addEqualityGroup(brb.setReceivedFromIp(Ip.parse("1.1.1.1")).build()) .addEqualityGroup(brb.setReceivedFromRouteReflectorClient(true).build()) .addEqualityGroup(brb.setProtocol(RoutingProtocol.IBGP).build()) .addEqualityGroup(brb.setSrcProtocol(RoutingProtocol.STATIC).build()) .addEqualityGroup(brb.setTag(3L).build()) .addEqualityGroup(brb.setWeight(1).build(), brb.build().toBuilder().build()) .addEqualityGroup(new Object()) .testEquals(); }
@Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof Bgpv4Route)) { return false; } Bgpv4Route other = (Bgpv4Route) o; return (_hashCode == other._hashCode || _hashCode == 0 || other._hashCode == 0) && _network.equals(other._network) && _nextHopIp.equals(other._nextHopIp) && _originatorIp.equals(other._originatorIp) && _nextHopInterface.equals(other._nextHopInterface) && Objects.equals(_receivedFromIp, other._receivedFromIp) && _admin == other._admin && _discard == other._discard && _localPreference == other._localPreference && _med == other._med && _originType == other._originType && _protocol == other._protocol && _receivedFromRouteReflectorClient == other._receivedFromRouteReflectorClient && _srcProtocol == other._srcProtocol && _tag == other._tag && _weight == other._weight && getNonRouting() == other.getNonRouting() && getNonForwarding() == other.getNonForwarding() && _asPath.equals(other._asPath) && _clusterList.equals(other._clusterList) && _communities.equals(other._communities); }
Bgpv4Route extends BgpRoute<Bgpv4Route.Builder, Bgpv4Route> { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof Bgpv4Route)) { return false; } Bgpv4Route other = (Bgpv4Route) o; return (_hashCode == other._hashCode || _hashCode == 0 || other._hashCode == 0) && _network.equals(other._network) && _nextHopIp.equals(other._nextHopIp) && _originatorIp.equals(other._originatorIp) && _nextHopInterface.equals(other._nextHopInterface) && Objects.equals(_receivedFromIp, other._receivedFromIp) && _admin == other._admin && _discard == other._discard && _localPreference == other._localPreference && _med == other._med && _originType == other._originType && _protocol == other._protocol && _receivedFromRouteReflectorClient == other._receivedFromRouteReflectorClient && _srcProtocol == other._srcProtocol && _tag == other._tag && _weight == other._weight && getNonRouting() == other.getNonRouting() && getNonForwarding() == other.getNonForwarding() && _asPath.equals(other._asPath) && _clusterList.equals(other._clusterList) && _communities.equals(other._communities); } }
Bgpv4Route extends BgpRoute<Bgpv4Route.Builder, Bgpv4Route> { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof Bgpv4Route)) { return false; } Bgpv4Route other = (Bgpv4Route) o; return (_hashCode == other._hashCode || _hashCode == 0 || other._hashCode == 0) && _network.equals(other._network) && _nextHopIp.equals(other._nextHopIp) && _originatorIp.equals(other._originatorIp) && _nextHopInterface.equals(other._nextHopInterface) && Objects.equals(_receivedFromIp, other._receivedFromIp) && _admin == other._admin && _discard == other._discard && _localPreference == other._localPreference && _med == other._med && _originType == other._originType && _protocol == other._protocol && _receivedFromRouteReflectorClient == other._receivedFromRouteReflectorClient && _srcProtocol == other._srcProtocol && _tag == other._tag && _weight == other._weight && getNonRouting() == other.getNonRouting() && getNonForwarding() == other.getNonForwarding() && _asPath.equals(other._asPath) && _clusterList.equals(other._clusterList) && _communities.equals(other._communities); } private  Bgpv4Route(
      @Nullable Prefix network,
      @Nullable Ip nextHopIp,
      int admin,
      @Nullable AsPath asPath,
      @Nullable Set<Community> communities,
      boolean discard,
      long localPreference,
      long med,
      String nextHopInterface,
      Ip originatorIp,
      @Nullable Set<Long> clusterList,
      boolean receivedFromRouteReflectorClient,
      OriginType originType,
      RoutingProtocol protocol,
      @Nullable Ip receivedFromIp,
      @Nullable RoutingProtocol srcProtocol,
      long tag,
      int weight,
      boolean nonForwarding,
      boolean nonRouting); }
Bgpv4Route extends BgpRoute<Bgpv4Route.Builder, Bgpv4Route> { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof Bgpv4Route)) { return false; } Bgpv4Route other = (Bgpv4Route) o; return (_hashCode == other._hashCode || _hashCode == 0 || other._hashCode == 0) && _network.equals(other._network) && _nextHopIp.equals(other._nextHopIp) && _originatorIp.equals(other._originatorIp) && _nextHopInterface.equals(other._nextHopInterface) && Objects.equals(_receivedFromIp, other._receivedFromIp) && _admin == other._admin && _discard == other._discard && _localPreference == other._localPreference && _med == other._med && _originType == other._originType && _protocol == other._protocol && _receivedFromRouteReflectorClient == other._receivedFromRouteReflectorClient && _srcProtocol == other._srcProtocol && _tag == other._tag && _weight == other._weight && getNonRouting() == other.getNonRouting() && getNonForwarding() == other.getNonForwarding() && _asPath.equals(other._asPath) && _clusterList.equals(other._clusterList) && _communities.equals(other._communities); } private  Bgpv4Route(
      @Nullable Prefix network,
      @Nullable Ip nextHopIp,
      int admin,
      @Nullable AsPath asPath,
      @Nullable Set<Community> communities,
      boolean discard,
      long localPreference,
      long med,
      String nextHopInterface,
      Ip originatorIp,
      @Nullable Set<Long> clusterList,
      boolean receivedFromRouteReflectorClient,
      OriginType originType,
      RoutingProtocol protocol,
      @Nullable Ip receivedFromIp,
      @Nullable RoutingProtocol srcProtocol,
      long tag,
      int weight,
      boolean nonForwarding,
      boolean nonRouting); static Builder builder(); @Override Builder toBuilder(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override String toString(); }
Bgpv4Route extends BgpRoute<Bgpv4Route.Builder, Bgpv4Route> { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof Bgpv4Route)) { return false; } Bgpv4Route other = (Bgpv4Route) o; return (_hashCode == other._hashCode || _hashCode == 0 || other._hashCode == 0) && _network.equals(other._network) && _nextHopIp.equals(other._nextHopIp) && _originatorIp.equals(other._originatorIp) && _nextHopInterface.equals(other._nextHopInterface) && Objects.equals(_receivedFromIp, other._receivedFromIp) && _admin == other._admin && _discard == other._discard && _localPreference == other._localPreference && _med == other._med && _originType == other._originType && _protocol == other._protocol && _receivedFromRouteReflectorClient == other._receivedFromRouteReflectorClient && _srcProtocol == other._srcProtocol && _tag == other._tag && _weight == other._weight && getNonRouting() == other.getNonRouting() && getNonForwarding() == other.getNonForwarding() && _asPath.equals(other._asPath) && _clusterList.equals(other._clusterList) && _communities.equals(other._communities); } private  Bgpv4Route(
      @Nullable Prefix network,
      @Nullable Ip nextHopIp,
      int admin,
      @Nullable AsPath asPath,
      @Nullable Set<Community> communities,
      boolean discard,
      long localPreference,
      long med,
      String nextHopInterface,
      Ip originatorIp,
      @Nullable Set<Long> clusterList,
      boolean receivedFromRouteReflectorClient,
      OriginType originType,
      RoutingProtocol protocol,
      @Nullable Ip receivedFromIp,
      @Nullable RoutingProtocol srcProtocol,
      long tag,
      int weight,
      boolean nonForwarding,
      boolean nonRouting); static Builder builder(); @Override Builder toBuilder(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override String toString();  }