@Test public void equals() { new EqualsTester() .addEqualityGroup(host("1.1.1.1", "us-east-1a", "1.2.3.4", "domain1", "myrole"), host("1.1.1.1", "us-east-1a", "1.2.3.4", "domain1", "myrole")) .addEqualityGroup(host("2.2.2.2", "us-east-1a", "1.2.3.4", "domain1", "myrole")) .addEqualityGroup(host("1.1.1.1", "eu-west-2c", "1.2.3.4", "domain1", "myrole")) .addEqualityGroup(host("1.1.1.1", "us-east-1a", "9.9.9.9", "domain1", "myrole")) .addEqualityGroup(host("1.1.1.1", "us-east-1a", "1.2.3.4", "domain2", "myrole")) .addEqualityGroup(host("1.1.1.1", "us-east-1a", "1.2.3.4", "domain1", "jellyr")) .testEquals(); }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } else if (obj == this) { return true; } else if (!getClass().isAssignableFrom(obj.getClass())) { return false; } return Arrays.equals(significantAttributes(), getClass().cast(obj).significantAttributes()); }
ZergHost { @Override public boolean equals(Object obj) { if (obj == null) { return false; } else if (obj == this) { return true; } else if (!getClass().isAssignableFrom(obj.getClass())) { return false; } return Arrays.equals(significantAttributes(), getClass().cast(obj).significantAttributes()); } }
ZergHost { @Override public boolean equals(Object obj) { if (obj == null) { return false; } else if (obj == this) { return true; } else if (!getClass().isAssignableFrom(obj.getClass())) { return false; } return Arrays.equals(significantAttributes(), getClass().cast(obj).significantAttributes()); } ZergHost(); @VisibleForTesting  ZergHost(String name, List<String> roles, String zone,
      String publicIpAddress, @Nullable String fullyQualifiedDomainName); }
ZergHost { @Override public boolean equals(Object obj) { if (obj == null) { return false; } else if (obj == this) { return true; } else if (!getClass().isAssignableFrom(obj.getClass())) { return false; } return Arrays.equals(significantAttributes(), getClass().cast(obj).significantAttributes()); } ZergHost(); @VisibleForTesting  ZergHost(String name, List<String> roles, String zone,
      String publicIpAddress, @Nullable String fullyQualifiedDomainName); int getId(); String getName(); void setName(String name); List<String> getRoles(); String getZone(); String getPublicIpAddress(); @Nullable String getFullyQualifiedDomainName(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
ZergHost { @Override public boolean equals(Object obj) { if (obj == null) { return false; } else if (obj == this) { return true; } else if (!getClass().isAssignableFrom(obj.getClass())) { return false; } return Arrays.equals(significantAttributes(), getClass().cast(obj).significantAttributes()); } ZergHost(); @VisibleForTesting  ZergHost(String name, List<String> roles, String zone,
      String publicIpAddress, @Nullable String fullyQualifiedDomainName); int getId(); String getName(); void setName(String name); List<String> getRoles(); String getZone(); String getPublicIpAddress(); @Nullable String getFullyQualifiedDomainName(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); private @SerializedName("ip") String publicIpAddress; }