@Test public void testEquals() { GeneratedRoute.Builder gr = GeneratedRoute.builder().setNetwork(Prefix.parse("1.1.1.0/24")).setMetric(1L); new EqualsTester() .addEqualityGroup(gr.build(), gr.build()) .addEqualityGroup(gr.setMetric(2L).build()) .addEqualityGroup(gr.setDiscard(true).build()) .addEqualityGroup(gr.setCommunities(ImmutableSet.of(StandardCommunity.of(111L))).build()) .addEqualityGroup(gr.setGenerationPolicy("GENERATE").build()) .addEqualityGroup(gr.setAttributePolicy("Attribute").build()) .addEqualityGroup(gr.setAdmin(100).build()) .addEqualityGroup(gr.setTag(5L).build()) .addEqualityGroup(gr.setNonRouting(true).build()) .addEqualityGroup(gr.setNonForwarding(true).build()) .addEqualityGroup(new Object()) .testEquals(); }
@Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof GeneratedRoute)) { return false; } GeneratedRoute that = (GeneratedRoute) o; return (_hashCode == that._hashCode || _hashCode == 0 || that._hashCode == 0) && _network.equals(that._network) && _admin == that._admin && getNonRouting() == that.getNonRouting() && getNonForwarding() == that.getNonForwarding() && _discard == that._discard && _metric == that._metric && _tag == that._tag && _asPath.equals(that._asPath) && Objects.equals(_attributePolicy, that._attributePolicy) && _communities.equals(that._communities) && Objects.equals(_generationPolicy, that._generationPolicy) && _nextHopInterface.equals(that._nextHopInterface) && _nextHopIp.equals(that._nextHopIp); }
GeneratedRoute extends AbstractRoute implements Comparable<GeneratedRoute> { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof GeneratedRoute)) { return false; } GeneratedRoute that = (GeneratedRoute) o; return (_hashCode == that._hashCode || _hashCode == 0 || that._hashCode == 0) && _network.equals(that._network) && _admin == that._admin && getNonRouting() == that.getNonRouting() && getNonForwarding() == that.getNonForwarding() && _discard == that._discard && _metric == that._metric && _tag == that._tag && _asPath.equals(that._asPath) && Objects.equals(_attributePolicy, that._attributePolicy) && _communities.equals(that._communities) && Objects.equals(_generationPolicy, that._generationPolicy) && _nextHopInterface.equals(that._nextHopInterface) && _nextHopIp.equals(that._nextHopIp); } }
GeneratedRoute extends AbstractRoute implements Comparable<GeneratedRoute> { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof GeneratedRoute)) { return false; } GeneratedRoute that = (GeneratedRoute) o; return (_hashCode == that._hashCode || _hashCode == 0 || that._hashCode == 0) && _network.equals(that._network) && _admin == that._admin && getNonRouting() == that.getNonRouting() && getNonForwarding() == that.getNonForwarding() && _discard == that._discard && _metric == that._metric && _tag == that._tag && _asPath.equals(that._asPath) && Objects.equals(_attributePolicy, that._attributePolicy) && _communities.equals(that._communities) && Objects.equals(_generationPolicy, that._generationPolicy) && _nextHopInterface.equals(that._nextHopInterface) && _nextHopIp.equals(that._nextHopIp); } private  GeneratedRoute(
      Prefix network,
      int administrativeCost,
      Ip nextHopIp,
      AsPath asPath,
      @Nullable String attributePolicy,
      @Nullable SortedSet<Community> communities,
      boolean discard,
      @Nullable String generationPolicy,
      long metric,
      String nextHopInterface,
      long tag,
      boolean nonForwarding,
      boolean nonRouting); }
GeneratedRoute extends AbstractRoute implements Comparable<GeneratedRoute> { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof GeneratedRoute)) { return false; } GeneratedRoute that = (GeneratedRoute) o; return (_hashCode == that._hashCode || _hashCode == 0 || that._hashCode == 0) && _network.equals(that._network) && _admin == that._admin && getNonRouting() == that.getNonRouting() && getNonForwarding() == that.getNonForwarding() && _discard == that._discard && _metric == that._metric && _tag == that._tag && _asPath.equals(that._asPath) && Objects.equals(_attributePolicy, that._attributePolicy) && _communities.equals(that._communities) && Objects.equals(_generationPolicy, that._generationPolicy) && _nextHopInterface.equals(that._nextHopInterface) && _nextHopIp.equals(that._nextHopIp); } private  GeneratedRoute(
      Prefix network,
      int administrativeCost,
      Ip nextHopIp,
      AsPath asPath,
      @Nullable String attributePolicy,
      @Nullable SortedSet<Community> communities,
      boolean discard,
      @Nullable String generationPolicy,
      long metric,
      String nextHopInterface,
      long tag,
      boolean nonForwarding,
      boolean nonRouting); static Builder builder(); @JsonProperty(PROP_AS_PATH) AsPath getAsPath(); @Nullable @JsonProperty(PROP_ATTRIBUTE_POLICY) String getAttributePolicy(); @JsonProperty(PROP_ATTRIBUTE_POLICY_SOURCES) SortedSet<String> getAttributePolicySources(); @Nonnull @JsonProperty(PROP_COMMUNITIES) SortedSet<Community> getCommunities(); @JsonProperty(PROP_DISCARD) boolean getDiscard(); @Nullable @JsonProperty(PROP_GENERATION_POLICY) String getGenerationPolicy(); @JsonProperty(PROP_GENERATION_POLICY_SOURCES) SortedSet<String> getGenerationPolicySources(); @JsonIgnore(false) @JsonProperty(PROP_METRIC) @Override Long getMetric(); @Nonnull @Override String getNextHopInterface(); @Nonnull @JsonIgnore(false) @JsonProperty(PROP_NEXT_HOP_IP) @Override Ip getNextHopIp(); @Override RoutingProtocol getProtocol(); @Override int compareTo(GeneratedRoute rhs); @JsonProperty(PROP_ATTRIBUTE_POLICY_SOURCES) void setAttributePolicySources(SortedSet<String> attributePolicySources); @JsonProperty(PROP_GENERATION_POLICY_SOURCES) void setGenerationPolicySources(SortedSet<String> generationPolicySources); @Override Builder toBuilder(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); }
GeneratedRoute extends AbstractRoute implements Comparable<GeneratedRoute> { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof GeneratedRoute)) { return false; } GeneratedRoute that = (GeneratedRoute) o; return (_hashCode == that._hashCode || _hashCode == 0 || that._hashCode == 0) && _network.equals(that._network) && _admin == that._admin && getNonRouting() == that.getNonRouting() && getNonForwarding() == that.getNonForwarding() && _discard == that._discard && _metric == that._metric && _tag == that._tag && _asPath.equals(that._asPath) && Objects.equals(_attributePolicy, that._attributePolicy) && _communities.equals(that._communities) && Objects.equals(_generationPolicy, that._generationPolicy) && _nextHopInterface.equals(that._nextHopInterface) && _nextHopIp.equals(that._nextHopIp); } private  GeneratedRoute(
      Prefix network,
      int administrativeCost,
      Ip nextHopIp,
      AsPath asPath,
      @Nullable String attributePolicy,
      @Nullable SortedSet<Community> communities,
      boolean discard,
      @Nullable String generationPolicy,
      long metric,
      String nextHopInterface,
      long tag,
      boolean nonForwarding,
      boolean nonRouting); static Builder builder(); @JsonProperty(PROP_AS_PATH) AsPath getAsPath(); @Nullable @JsonProperty(PROP_ATTRIBUTE_POLICY) String getAttributePolicy(); @JsonProperty(PROP_ATTRIBUTE_POLICY_SOURCES) SortedSet<String> getAttributePolicySources(); @Nonnull @JsonProperty(PROP_COMMUNITIES) SortedSet<Community> getCommunities(); @JsonProperty(PROP_DISCARD) boolean getDiscard(); @Nullable @JsonProperty(PROP_GENERATION_POLICY) String getGenerationPolicy(); @JsonProperty(PROP_GENERATION_POLICY_SOURCES) SortedSet<String> getGenerationPolicySources(); @JsonIgnore(false) @JsonProperty(PROP_METRIC) @Override Long getMetric(); @Nonnull @Override String getNextHopInterface(); @Nonnull @JsonIgnore(false) @JsonProperty(PROP_NEXT_HOP_IP) @Override Ip getNextHopIp(); @Override RoutingProtocol getProtocol(); @Override int compareTo(GeneratedRoute rhs); @JsonProperty(PROP_ATTRIBUTE_POLICY_SOURCES) void setAttributePolicySources(SortedSet<String> attributePolicySources); @JsonProperty(PROP_GENERATION_POLICY_SOURCES) void setGenerationPolicySources(SortedSet<String> generationPolicySources); @Override Builder toBuilder(); @Override boolean equals(@Nullable Object o); @Override int hashCode();  }