@Test public void testEquals() { BgpPeerConfigId id = new BgpPeerConfigId("c1", "vrf1", Prefix.ZERO, false); new EqualsTester() .addEqualityGroup(id, id, new BgpPeerConfigId("c1", "vrf1", Prefix.ZERO, false)) .addEqualityGroup(new BgpPeerConfigId("c2", "vrf1", Prefix.ZERO, false)) .addEqualityGroup(new BgpPeerConfigId("c1", "vrf2", Prefix.ZERO, false)) .addEqualityGroup(new BgpPeerConfigId("c1", "vrf1", Prefix.parse("1.1.1.1/24"), false)) .addEqualityGroup(new BgpPeerConfigId("c1", "vrf1", Prefix.ZERO, true)) .addEqualityGroup(new BgpPeerConfigId("c1", "vrf1", "peerIface")) .addEqualityGroup(new BgpPeerConfigId("c1", "vrf1", "peerIface2")) .addEqualityGroup(new Object()) .testEquals(); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BgpPeerConfigId)) { return false; } BgpPeerConfigId other = (BgpPeerConfigId) o; return (_hashCode == other._hashCode || _hashCode == 0 || other._hashCode == 0) && _type == other._type && _hostname.equals(other._hostname) && _vrfName.equals(other._vrfName) && Objects.equals(_peerInterface, other._peerInterface) && Objects.equals(_remotePeerPrefix, other._remotePeerPrefix); }
BgpPeerConfigId implements Comparable<BgpPeerConfigId> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BgpPeerConfigId)) { return false; } BgpPeerConfigId other = (BgpPeerConfigId) o; return (_hashCode == other._hashCode || _hashCode == 0 || other._hashCode == 0) && _type == other._type && _hostname.equals(other._hostname) && _vrfName.equals(other._vrfName) && Objects.equals(_peerInterface, other._peerInterface) && Objects.equals(_remotePeerPrefix, other._remotePeerPrefix); } }
BgpPeerConfigId implements Comparable<BgpPeerConfigId> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BgpPeerConfigId)) { return false; } BgpPeerConfigId other = (BgpPeerConfigId) o; return (_hashCode == other._hashCode || _hashCode == 0 || other._hashCode == 0) && _type == other._type && _hostname.equals(other._hostname) && _vrfName.equals(other._vrfName) && Objects.equals(_peerInterface, other._peerInterface) && Objects.equals(_remotePeerPrefix, other._remotePeerPrefix); } BgpPeerConfigId(
      @Nonnull String hostname,
      @Nonnull String vrfName,
      @Nonnull Prefix remotePeerPrefix,
      boolean dynamic);  BgpPeerConfigId(
      @Nonnull String hostname, @Nonnull String vrfName, @Nonnull String peerInterface); }
BgpPeerConfigId implements Comparable<BgpPeerConfigId> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BgpPeerConfigId)) { return false; } BgpPeerConfigId other = (BgpPeerConfigId) o; return (_hashCode == other._hashCode || _hashCode == 0 || other._hashCode == 0) && _type == other._type && _hostname.equals(other._hostname) && _vrfName.equals(other._vrfName) && Objects.equals(_peerInterface, other._peerInterface) && Objects.equals(_remotePeerPrefix, other._remotePeerPrefix); } BgpPeerConfigId(
      @Nonnull String hostname,
      @Nonnull String vrfName,
      @Nonnull Prefix remotePeerPrefix,
      boolean dynamic);  BgpPeerConfigId(
      @Nonnull String hostname, @Nonnull String vrfName, @Nonnull String peerInterface); @Nonnull @JsonProperty(PROP_HOSTNAME) String getHostname(); @Nonnull @JsonProperty(PROP_VRF_NAME) String getVrfName(); @Nullable @JsonProperty(PROP_INTERFACE) String getPeerInterface(); @Nullable @JsonProperty(PROP_PREFIX) Prefix getRemotePeerPrefix(); @Nonnull @JsonProperty(PROP_TYPE) BgpPeerConfigType getType(); @Override int compareTo(@Nonnull BgpPeerConfigId o); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
BgpPeerConfigId implements Comparable<BgpPeerConfigId> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BgpPeerConfigId)) { return false; } BgpPeerConfigId other = (BgpPeerConfigId) o; return (_hashCode == other._hashCode || _hashCode == 0 || other._hashCode == 0) && _type == other._type && _hostname.equals(other._hostname) && _vrfName.equals(other._vrfName) && Objects.equals(_peerInterface, other._peerInterface) && Objects.equals(_remotePeerPrefix, other._remotePeerPrefix); } BgpPeerConfigId(
      @Nonnull String hostname,
      @Nonnull String vrfName,
      @Nonnull Prefix remotePeerPrefix,
      boolean dynamic);  BgpPeerConfigId(
      @Nonnull String hostname, @Nonnull String vrfName, @Nonnull String peerInterface); @Nonnull @JsonProperty(PROP_HOSTNAME) String getHostname(); @Nonnull @JsonProperty(PROP_VRF_NAME) String getVrfName(); @Nullable @JsonProperty(PROP_INTERFACE) String getPeerInterface(); @Nullable @JsonProperty(PROP_PREFIX) Prefix getRemotePeerPrefix(); @Nonnull @JsonProperty(PROP_TYPE) BgpPeerConfigType getType(); @Override int compareTo(@Nonnull BgpPeerConfigId o); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }