@Test public void testEquals() { new EqualsTester() .addEqualityGroup( NodeInterfacePair.of("host", "iface"), NodeInterfacePair.of("host", "iface"), NodeInterfacePair.of("HOST", "iface")) .addEqualityGroup(NodeInterfacePair.of("otherHost", "iface")) .addEqualityGroup(NodeInterfacePair.of("host", "otherIface")) .addEqualityGroup(NodeInterfacePair.of("host", "IFACE")) .addEqualityGroup(new Object()) .testEquals(); }
@Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } else if (!(o instanceof NodeInterfacePair)) { return false; } NodeInterfacePair that = (NodeInterfacePair) o; return _hostname.equals(that._hostname) && _interfaceName.equals(that._interfaceName); }
NodeInterfacePair implements Serializable, Comparable<NodeInterfacePair> { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } else if (!(o instanceof NodeInterfacePair)) { return false; } NodeInterfacePair that = (NodeInterfacePair) o; return _hostname.equals(that._hostname) && _interfaceName.equals(that._interfaceName); } }
NodeInterfacePair implements Serializable, Comparable<NodeInterfacePair> { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } else if (!(o instanceof NodeInterfacePair)) { return false; } NodeInterfacePair that = (NodeInterfacePair) o; return _hostname.equals(that._hostname) && _interfaceName.equals(that._interfaceName); } private  NodeInterfacePair(String hostname, String interfaceName); }
NodeInterfacePair implements Serializable, Comparable<NodeInterfacePair> { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } else if (!(o instanceof NodeInterfacePair)) { return false; } NodeInterfacePair that = (NodeInterfacePair) o; return _hostname.equals(that._hostname) && _interfaceName.equals(that._interfaceName); } private  NodeInterfacePair(String hostname, String interfaceName); static NodeInterfacePair of(String hostname, String interfaceName); static NodeInterfacePair of(Interface iface); @JsonProperty(PROP_HOSTNAME) @Nonnull String getHostname(); @JsonProperty(PROP_INTERFACE) @Nonnull String getInterface(); @Override String toString(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override int compareTo(NodeInterfacePair other); }
NodeInterfacePair implements Serializable, Comparable<NodeInterfacePair> { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } else if (!(o instanceof NodeInterfacePair)) { return false; } NodeInterfacePair that = (NodeInterfacePair) o; return _hostname.equals(that._hostname) && _interfaceName.equals(that._interfaceName); } private  NodeInterfacePair(String hostname, String interfaceName); static NodeInterfacePair of(String hostname, String interfaceName); static NodeInterfacePair of(Interface iface); @JsonProperty(PROP_HOSTNAME) @Nonnull String getHostname(); @JsonProperty(PROP_INTERFACE) @Nonnull String getInterface(); @Override String toString(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override int compareTo(NodeInterfacePair other);  }