@Test public void testEquals() { Builder builder = builder() .setL2Vnis(ImmutableSet.of()) .setL3Vnis(ImmutableSet.of()) .setPropagateUnmatched(false); EvpnAddressFamily af = builder.build(); new EqualsTester() .addEqualityGroup(af, af, builder.build()) .addEqualityGroup( builder .setAddressFamilyCapabilities( AddressFamilyCapabilities.builder().setSendCommunity(true).build()) .build()) .addEqualityGroup(builder.setExportPolicy("export").build()) .addEqualityGroup(builder.setImportPolicy("import").build()) .addEqualityGroup(builder.setExportPolicySources(ImmutableSortedSet.of("foo")).build()) .addEqualityGroup(builder.setImportPolicySources(ImmutableSortedSet.of("bar")).build()) .addEqualityGroup( builder .setL2Vnis( ImmutableSet.of( Layer2VniConfig.builder() .setVni(1) .setVrf("v") .setRouteDistinguisher(RouteDistinguisher.from(1L, 1)) .setRouteTarget(ExtendedCommunity.of(0, 1, 1)) .build())) .build()) .addEqualityGroup( builder .setL3Vnis( ImmutableSet.of( Layer3VniConfig.builder() .setVni(1) .setVrf("v") .setRouteDistinguisher(RouteDistinguisher.from(1L, 1)) .setRouteTarget(ExtendedCommunity.of(0, 1, 1)) .setImportRouteTarget(VniConfig.importRtPatternForAnyAs(1)) .setAdvertiseV4Unicast(false) .build())) .build()) .addEqualityGroup(builder.setPropagateUnmatched(true).build()) .addEqualityGroup(builder.setRouteReflectorClient(true)) .addEqualityGroup(new Object()) .testEquals(); }
@Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof EvpnAddressFamily)) { return false; } EvpnAddressFamily that = (EvpnAddressFamily) o; return _addressFamilyCapabilities.equals(that._addressFamilyCapabilities) && Objects.equals(_exportPolicy, that._exportPolicy) && Objects.equals(_importPolicy, that._importPolicy) && _exportPolicySources.equals(that._exportPolicySources) && _importPolicySources.equals(that._importPolicySources) && _routeReflectorClient == that._routeReflectorClient && _l2VNIs.equals(that._l2VNIs) && _l3VNIs.equals(that._l3VNIs) && _propagateUnmatched == that._propagateUnmatched; }
EvpnAddressFamily extends AddressFamily { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof EvpnAddressFamily)) { return false; } EvpnAddressFamily that = (EvpnAddressFamily) o; return _addressFamilyCapabilities.equals(that._addressFamilyCapabilities) && Objects.equals(_exportPolicy, that._exportPolicy) && Objects.equals(_importPolicy, that._importPolicy) && _exportPolicySources.equals(that._exportPolicySources) && _importPolicySources.equals(that._importPolicySources) && _routeReflectorClient == that._routeReflectorClient && _l2VNIs.equals(that._l2VNIs) && _l3VNIs.equals(that._l3VNIs) && _propagateUnmatched == that._propagateUnmatched; } }
EvpnAddressFamily extends AddressFamily { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof EvpnAddressFamily)) { return false; } EvpnAddressFamily that = (EvpnAddressFamily) o; return _addressFamilyCapabilities.equals(that._addressFamilyCapabilities) && Objects.equals(_exportPolicy, that._exportPolicy) && Objects.equals(_importPolicy, that._importPolicy) && _exportPolicySources.equals(that._exportPolicySources) && _importPolicySources.equals(that._importPolicySources) && _routeReflectorClient == that._routeReflectorClient && _l2VNIs.equals(that._l2VNIs) && _l3VNIs.equals(that._l3VNIs) && _propagateUnmatched == that._propagateUnmatched; } protected  EvpnAddressFamily(
      // super fields
      AddressFamilyCapabilities addressFamilyCapabilities,
      @Nullable String exportPolicy,
      SortedSet<String> exportPolicySources,
      @Nullable String importPolicy,
      SortedSet<String> importPolicySources,
      boolean routeReflectorClient,
      // local fields
      Set<Layer2VniConfig> l2Vnis,
      Set<Layer3VniConfig> l3Vnis,
      boolean propagateUnmatched); }
EvpnAddressFamily extends AddressFamily { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof EvpnAddressFamily)) { return false; } EvpnAddressFamily that = (EvpnAddressFamily) o; return _addressFamilyCapabilities.equals(that._addressFamilyCapabilities) && Objects.equals(_exportPolicy, that._exportPolicy) && Objects.equals(_importPolicy, that._importPolicy) && _exportPolicySources.equals(that._exportPolicySources) && _importPolicySources.equals(that._importPolicySources) && _routeReflectorClient == that._routeReflectorClient && _l2VNIs.equals(that._l2VNIs) && _l3VNIs.equals(that._l3VNIs) && _propagateUnmatched == that._propagateUnmatched; } protected  EvpnAddressFamily(
      // super fields
      AddressFamilyCapabilities addressFamilyCapabilities,
      @Nullable String exportPolicy,
      SortedSet<String> exportPolicySources,
      @Nullable String importPolicy,
      SortedSet<String> importPolicySources,
      boolean routeReflectorClient,
      // local fields
      Set<Layer2VniConfig> l2Vnis,
      Set<Layer3VniConfig> l3Vnis,
      boolean propagateUnmatched); @Nonnull @JsonProperty(PROP_L2_VNIS) SortedSet<Layer2VniConfig> getL2VNIs(); @Nonnull @JsonProperty(PROP_L3_VNIS) SortedSet<Layer3VniConfig> getL3VNIs(); @JsonProperty(PROP_PROPAGATE_UNMATCHED) boolean getPropagateUnmatched(); @Override Type getType(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Nonnull static Builder builder(); }
EvpnAddressFamily extends AddressFamily { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof EvpnAddressFamily)) { return false; } EvpnAddressFamily that = (EvpnAddressFamily) o; return _addressFamilyCapabilities.equals(that._addressFamilyCapabilities) && Objects.equals(_exportPolicy, that._exportPolicy) && Objects.equals(_importPolicy, that._importPolicy) && _exportPolicySources.equals(that._exportPolicySources) && _importPolicySources.equals(that._importPolicySources) && _routeReflectorClient == that._routeReflectorClient && _l2VNIs.equals(that._l2VNIs) && _l3VNIs.equals(that._l3VNIs) && _propagateUnmatched == that._propagateUnmatched; } protected  EvpnAddressFamily(
      // super fields
      AddressFamilyCapabilities addressFamilyCapabilities,
      @Nullable String exportPolicy,
      SortedSet<String> exportPolicySources,
      @Nullable String importPolicy,
      SortedSet<String> importPolicySources,
      boolean routeReflectorClient,
      // local fields
      Set<Layer2VniConfig> l2Vnis,
      Set<Layer3VniConfig> l3Vnis,
      boolean propagateUnmatched); @Nonnull @JsonProperty(PROP_L2_VNIS) SortedSet<Layer2VniConfig> getL2VNIs(); @Nonnull @JsonProperty(PROP_L3_VNIS) SortedSet<Layer3VniConfig> getL3VNIs(); @JsonProperty(PROP_PROPAGATE_UNMATCHED) boolean getPropagateUnmatched(); @Override Type getType(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Nonnull static Builder builder();  }