@Test public void testEquals() { new EqualsTester() .addEqualityGroup( new Vpc("owner", "vpc", ImmutableSet.of(), ImmutableMap.of()), new Vpc("owner", "vpc", ImmutableSet.of(), ImmutableMap.of())) .addEqualityGroup(new Vpc("other", "vpc", ImmutableSet.of(), ImmutableMap.of())) .addEqualityGroup(new Vpc("owner", "other", ImmutableSet.of(), ImmutableMap.of())) .addEqualityGroup(new Vpc("owner", "vpc", ImmutableSet.of(Prefix.ZERO), ImmutableMap.of())) .addEqualityGroup( new Vpc("owner", "vpc", ImmutableSet.of(), ImmutableMap.of("name", "value"))) .testEquals(); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Vpc)) { return false; } Vpc vpc = (Vpc) o; return Objects.equals(_cidrBlockAssociations, vpc._cidrBlockAssociations) && Objects.equals(_ownerId, vpc._ownerId) && Objects.equals(_tags, vpc._tags) && Objects.equals(_vpcId, vpc._vpcId); }
Vpc implements AwsVpcEntity, Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Vpc)) { return false; } Vpc vpc = (Vpc) o; return Objects.equals(_cidrBlockAssociations, vpc._cidrBlockAssociations) && Objects.equals(_ownerId, vpc._ownerId) && Objects.equals(_tags, vpc._tags) && Objects.equals(_vpcId, vpc._vpcId); } }
Vpc implements AwsVpcEntity, Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Vpc)) { return false; } Vpc vpc = (Vpc) o; return Objects.equals(_cidrBlockAssociations, vpc._cidrBlockAssociations) && Objects.equals(_ownerId, vpc._ownerId) && Objects.equals(_tags, vpc._tags) && Objects.equals(_vpcId, vpc._vpcId); } Vpc(String ownerId, String vpcId, Set<Prefix> cidrBlockAssociations, Map<String, String> tags); }
Vpc implements AwsVpcEntity, Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Vpc)) { return false; } Vpc vpc = (Vpc) o; return Objects.equals(_cidrBlockAssociations, vpc._cidrBlockAssociations) && Objects.equals(_ownerId, vpc._ownerId) && Objects.equals(_tags, vpc._tags) && Objects.equals(_vpcId, vpc._vpcId); } Vpc(String ownerId, String vpcId, Set<Prefix> cidrBlockAssociations, Map<String, String> tags); @Nonnull String getOwnerId(); @Override String getId(); @Override boolean equals(Object o); @Override int hashCode(); }
Vpc implements AwsVpcEntity, Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Vpc)) { return false; } Vpc vpc = (Vpc) o; return Objects.equals(_cidrBlockAssociations, vpc._cidrBlockAssociations) && Objects.equals(_ownerId, vpc._ownerId) && Objects.equals(_tags, vpc._tags) && Objects.equals(_vpcId, vpc._vpcId); } Vpc(String ownerId, String vpcId, Set<Prefix> cidrBlockAssociations, Map<String, String> tags); @Nonnull String getOwnerId(); @Override String getId(); @Override boolean equals(Object o); @Override int hashCode();  }