@Test public void testEquals() { BgpUnnumberedPeerConfig.Builder builder = BgpUnnumberedPeerConfig.builder() .setPeerInterface("eth1") .setIpv4UnicastAddressFamily(Ipv4UnicastAddressFamily.builder().build()); BgpUnnumberedPeerConfig c = builder.build(); new EqualsTester() .addEqualityGroup(new Object()) .addEqualityGroup(c, c, builder.build()) .addEqualityGroup( builder .setIpv4UnicastAddressFamily( Ipv4UnicastAddressFamily.builder() .setAddressFamilyCapabilities( AddressFamilyCapabilities.builder().setSendCommunity(true).build()) .build()) .build()) .addEqualityGroup( builder .setAppliedRibGroup( new RibGroup( "blah", ImmutableList.of(new RibId("d", "e", "f")), "blah1", new RibId("a", "b", "c"))) .build()) .addEqualityGroup(builder.setAuthenticationSettings(BGP_AUTHENTICATION_SETTINGS).build()) .addEqualityGroup(builder.setClusterId(5L).build()) .addEqualityGroup(builder.setDefaultMetric(5).build()) .addEqualityGroup(builder.setDescription("foo").build()) .addEqualityGroup(builder.setEbgpMultihop(true).build()) .addEqualityGroup(builder.setEnforceFirstAs(true).build()) .addEqualityGroup( builder .setIpv4UnicastAddressFamily( Ipv4UnicastAddressFamily.builder().setExportPolicy("bar").build()) .build()) .addEqualityGroup( builder .setGeneratedRoutes( ImmutableSet.of( GeneratedRoute.builder().setNetwork(Prefix.ZERO).setDiscard(true).build())) .build()) .addEqualityGroup(builder.setGroup("g1").build()) .addEqualityGroup( builder .setIpv4UnicastAddressFamily( Ipv4UnicastAddressFamily.builder().setExportPolicy("boo").build()) .build()) .addEqualityGroup(builder.setLocalAs(10L).build()) .addEqualityGroup(builder.setLocalIp(Ip.FIRST_CLASS_A_PRIVATE_IP).build()) .addEqualityGroup(builder.setPeerInterface("eth0").build()) .addEqualityGroup(builder.setRemoteAsns(LongSpace.of(11L)).build()) .addEqualityGroup( builder.setEvpnAddressFamily( EvpnAddressFamily.builder().setPropagateUnmatched(true).build())) .testEquals(); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BgpUnnumberedPeerConfig)) { return false; } BgpUnnumberedPeerConfig that = (BgpUnnumberedPeerConfig) o; return _peerInterface.equals(that._peerInterface) && super.equals(o); }
BgpUnnumberedPeerConfig extends BgpPeerConfig { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BgpUnnumberedPeerConfig)) { return false; } BgpUnnumberedPeerConfig that = (BgpUnnumberedPeerConfig) o; return _peerInterface.equals(that._peerInterface) && super.equals(o); } }
BgpUnnumberedPeerConfig extends BgpPeerConfig { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BgpUnnumberedPeerConfig)) { return false; } BgpUnnumberedPeerConfig that = (BgpUnnumberedPeerConfig) o; return _peerInterface.equals(that._peerInterface) && super.equals(o); } private  BgpUnnumberedPeerConfig(
      @Nullable RibGroup appliedRibGroup,
      @Nullable BgpAuthenticationSettings authenticationSettings,
      @Nullable Long clusterId,
      @Nullable Long confederation,
      int defaultMetric,
      @Nullable String description,
      boolean ebgpMultihop,
      boolean enforceFirstAs,
      @Nullable Set<GeneratedRoute> generatedRoutes,
      @Nullable String group,
      @Nullable Long localAs,
      @Nullable Ip localIp,
      @Nonnull String peerInterface,
      @Nullable LongSpace remoteAsns,
      @Nullable Ipv4UnicastAddressFamily ipv4UnicastAddressFamily,
      @Nullable EvpnAddressFamily evpnAddressFamily); }
BgpUnnumberedPeerConfig extends BgpPeerConfig { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BgpUnnumberedPeerConfig)) { return false; } BgpUnnumberedPeerConfig that = (BgpUnnumberedPeerConfig) o; return _peerInterface.equals(that._peerInterface) && super.equals(o); } private  BgpUnnumberedPeerConfig(
      @Nullable RibGroup appliedRibGroup,
      @Nullable BgpAuthenticationSettings authenticationSettings,
      @Nullable Long clusterId,
      @Nullable Long confederation,
      int defaultMetric,
      @Nullable String description,
      boolean ebgpMultihop,
      boolean enforceFirstAs,
      @Nullable Set<GeneratedRoute> generatedRoutes,
      @Nullable String group,
      @Nullable Long localAs,
      @Nullable Ip localIp,
      @Nonnull String peerInterface,
      @Nullable LongSpace remoteAsns,
      @Nullable Ipv4UnicastAddressFamily ipv4UnicastAddressFamily,
      @Nullable EvpnAddressFamily evpnAddressFamily); static Builder builder(); @Nonnull @JsonProperty(PROP_PEER_INTERFACE) String getPeerInterface(); @Override boolean equals(Object o); @Override int hashCode(); }
BgpUnnumberedPeerConfig extends BgpPeerConfig { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BgpUnnumberedPeerConfig)) { return false; } BgpUnnumberedPeerConfig that = (BgpUnnumberedPeerConfig) o; return _peerInterface.equals(that._peerInterface) && super.equals(o); } private  BgpUnnumberedPeerConfig(
      @Nullable RibGroup appliedRibGroup,
      @Nullable BgpAuthenticationSettings authenticationSettings,
      @Nullable Long clusterId,
      @Nullable Long confederation,
      int defaultMetric,
      @Nullable String description,
      boolean ebgpMultihop,
      boolean enforceFirstAs,
      @Nullable Set<GeneratedRoute> generatedRoutes,
      @Nullable String group,
      @Nullable Long localAs,
      @Nullable Ip localIp,
      @Nonnull String peerInterface,
      @Nullable LongSpace remoteAsns,
      @Nullable Ipv4UnicastAddressFamily ipv4UnicastAddressFamily,
      @Nullable EvpnAddressFamily evpnAddressFamily); static Builder builder(); @Nonnull @JsonProperty(PROP_PEER_INTERFACE) String getPeerInterface(); @Override boolean equals(Object o); @Override int hashCode();  }