@Test public void testEquals() { Builder brb = BgpRoute.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.setAsPath(AsPath.ofSingletonAsSets(1L, 1L)).build()) .addEqualityGroup(brb.setCommunities(ImmutableSet.of(StandardCommunity.of(1L))).build()) .addEqualityGroup(brb.setLocalPreference(10).build()) .addEqualityGroup(brb.setMetric(10).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.setProtocol(RoutingProtocol.IBGP).build()) .addEqualityGroup(brb.setSrcProtocol(RoutingProtocol.STATIC).build()) .addEqualityGroup(brb.setWeight(1).build()) .addEqualityGroup(new Object()) .testEquals(); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BgpRoute)) { return false; } BgpRoute bgpRoute = (BgpRoute) o; return _localPreference == bgpRoute._localPreference && _metric == bgpRoute._metric && _weight == bgpRoute._weight && Objects.equals(_asPath, bgpRoute._asPath) && Objects.equals(_communities, bgpRoute._communities) && Objects.equals(_network, bgpRoute._network) && Objects.equals(_nextHopIp, bgpRoute._nextHopIp) && Objects.equals(_originatorIp, bgpRoute._originatorIp) && _originType == bgpRoute._originType && _protocol == bgpRoute._protocol && _srcProtocol == bgpRoute._srcProtocol; }
BgpRoute { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BgpRoute)) { return false; } BgpRoute bgpRoute = (BgpRoute) o; return _localPreference == bgpRoute._localPreference && _metric == bgpRoute._metric && _weight == bgpRoute._weight && Objects.equals(_asPath, bgpRoute._asPath) && Objects.equals(_communities, bgpRoute._communities) && Objects.equals(_network, bgpRoute._network) && Objects.equals(_nextHopIp, bgpRoute._nextHopIp) && Objects.equals(_originatorIp, bgpRoute._originatorIp) && _originType == bgpRoute._originType && _protocol == bgpRoute._protocol && _srcProtocol == bgpRoute._srcProtocol; } }
BgpRoute { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BgpRoute)) { return false; } BgpRoute bgpRoute = (BgpRoute) o; return _localPreference == bgpRoute._localPreference && _metric == bgpRoute._metric && _weight == bgpRoute._weight && Objects.equals(_asPath, bgpRoute._asPath) && Objects.equals(_communities, bgpRoute._communities) && Objects.equals(_network, bgpRoute._network) && Objects.equals(_nextHopIp, bgpRoute._nextHopIp) && Objects.equals(_originatorIp, bgpRoute._originatorIp) && _originType == bgpRoute._originType && _protocol == bgpRoute._protocol && _srcProtocol == bgpRoute._srcProtocol; } private  BgpRoute(
      AsPath asPath,
      SortedSet<Community> communities,
      long localPreference,
      long metric,
      Prefix network,
      Ip nextHopIp,
      Ip originatorIp,
      OriginType originType,
      RoutingProtocol protocol,
      @Nullable RoutingProtocol srcProtocol,
      int weight); }
BgpRoute { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BgpRoute)) { return false; } BgpRoute bgpRoute = (BgpRoute) o; return _localPreference == bgpRoute._localPreference && _metric == bgpRoute._metric && _weight == bgpRoute._weight && Objects.equals(_asPath, bgpRoute._asPath) && Objects.equals(_communities, bgpRoute._communities) && Objects.equals(_network, bgpRoute._network) && Objects.equals(_nextHopIp, bgpRoute._nextHopIp) && Objects.equals(_originatorIp, bgpRoute._originatorIp) && _originType == bgpRoute._originType && _protocol == bgpRoute._protocol && _srcProtocol == bgpRoute._srcProtocol; } private  BgpRoute(
      AsPath asPath,
      SortedSet<Community> communities,
      long localPreference,
      long metric,
      Prefix network,
      Ip nextHopIp,
      Ip originatorIp,
      OriginType originType,
      RoutingProtocol protocol,
      @Nullable RoutingProtocol srcProtocol,
      int weight); @Nonnull @JsonProperty(PROP_AS_PATH) AsPath getAsPath(); @Nonnull @JsonProperty(PROP_COMMUNITIES) SortedSet<Community> getCommunities(); @JsonProperty(PROP_LOCAL_PREFERENCE) long getLocalPreference(); @JsonProperty(PROP_METRIC) long getMetric(); @Nonnull @JsonProperty(PROP_NETWORK) Prefix getNetwork(); @Nonnull @JsonProperty(PROP_NEXT_HOP_IP) Ip getNextHopIp(); @Nonnull @JsonProperty(PROP_ORIGINATOR_IP) Ip getOriginatorIp(); @Nonnull @JsonProperty(PROP_ORIGIN_TYPE) OriginType getOriginType(); @Nonnull @JsonProperty(PROP_PROTOCOL) RoutingProtocol getProtocol(); @Nullable @JsonProperty(PROP_SRC_PROTOCOL) RoutingProtocol getSrcProtocol(); @JsonProperty(PROP_WEIGHT) int getWeight(); @Override boolean equals(Object o); @Override int hashCode(); static Builder builder(); Builder toBuilder(); }
BgpRoute { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BgpRoute)) { return false; } BgpRoute bgpRoute = (BgpRoute) o; return _localPreference == bgpRoute._localPreference && _metric == bgpRoute._metric && _weight == bgpRoute._weight && Objects.equals(_asPath, bgpRoute._asPath) && Objects.equals(_communities, bgpRoute._communities) && Objects.equals(_network, bgpRoute._network) && Objects.equals(_nextHopIp, bgpRoute._nextHopIp) && Objects.equals(_originatorIp, bgpRoute._originatorIp) && _originType == bgpRoute._originType && _protocol == bgpRoute._protocol && _srcProtocol == bgpRoute._srcProtocol; } private  BgpRoute(
      AsPath asPath,
      SortedSet<Community> communities,
      long localPreference,
      long metric,
      Prefix network,
      Ip nextHopIp,
      Ip originatorIp,
      OriginType originType,
      RoutingProtocol protocol,
      @Nullable RoutingProtocol srcProtocol,
      int weight); @Nonnull @JsonProperty(PROP_AS_PATH) AsPath getAsPath(); @Nonnull @JsonProperty(PROP_COMMUNITIES) SortedSet<Community> getCommunities(); @JsonProperty(PROP_LOCAL_PREFERENCE) long getLocalPreference(); @JsonProperty(PROP_METRIC) long getMetric(); @Nonnull @JsonProperty(PROP_NETWORK) Prefix getNetwork(); @Nonnull @JsonProperty(PROP_NEXT_HOP_IP) Ip getNextHopIp(); @Nonnull @JsonProperty(PROP_ORIGINATOR_IP) Ip getOriginatorIp(); @Nonnull @JsonProperty(PROP_ORIGIN_TYPE) OriginType getOriginType(); @Nonnull @JsonProperty(PROP_PROTOCOL) RoutingProtocol getProtocol(); @Nullable @JsonProperty(PROP_SRC_PROTOCOL) RoutingProtocol getSrcProtocol(); @JsonProperty(PROP_WEIGHT) int getWeight(); @Override boolean equals(Object o); @Override int hashCode(); static Builder builder(); Builder toBuilder(); static final String PROP_AS_PATH; static final String PROP_COMMUNITIES; static final String PROP_LOCAL_PREFERENCE; static final String PROP_METRIC; static final String PROP_NETWORK; static final String PROP_NEXT_HOP_IP; static final String PROP_ORIGINATOR_IP; static final String PROP_ORIGIN_TYPE; static final String PROP_PROTOCOL; static final String PROP_SRC_PROTOCOL; static final String PROP_WEIGHT; static final String PROP_CLASS; }