@Test public void testEquals() { Prefix prefix = Prefix.parse("1.1.1.1/32"); new EqualsTester() .addEqualityGroup( new PrefixList("id", ImmutableList.of(prefix), "name"), new PrefixList("id", ImmutableList.of(prefix), "name")) .addEqualityGroup(new PrefixList("other", ImmutableList.of(prefix), "name")) .addEqualityGroup( new PrefixList("id", ImmutableList.of(Prefix.parse("2.2.2.2/32")), "name")) .addEqualityGroup(new PrefixList("id", ImmutableList.of(prefix), "other")) .testEquals(); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof PrefixList)) { return false; } PrefixList that = (PrefixList) o; return _cidrs.equals(that._cidrs) && Objects.equals(_prefixListId, that._prefixListId) && _prefixListName.equals(that._prefixListName); }
PrefixList implements AwsVpcEntity, Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof PrefixList)) { return false; } PrefixList that = (PrefixList) o; return _cidrs.equals(that._cidrs) && Objects.equals(_prefixListId, that._prefixListId) && _prefixListName.equals(that._prefixListName); } }
PrefixList implements AwsVpcEntity, Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof PrefixList)) { return false; } PrefixList that = (PrefixList) o; return _cidrs.equals(that._cidrs) && Objects.equals(_prefixListId, that._prefixListId) && _prefixListName.equals(that._prefixListName); } PrefixList(String prefixListId, List<Prefix> cidrs, String prefixListName); }
PrefixList implements AwsVpcEntity, Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof PrefixList)) { return false; } PrefixList that = (PrefixList) o; return _cidrs.equals(that._cidrs) && Objects.equals(_prefixListId, that._prefixListId) && _prefixListName.equals(that._prefixListName); } PrefixList(String prefixListId, List<Prefix> cidrs, String prefixListName); @Nonnull List<Prefix> getCidrs(); @Override String getId(); @Nonnull String getPrefixListName(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
PrefixList implements AwsVpcEntity, Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof PrefixList)) { return false; } PrefixList that = (PrefixList) o; return _cidrs.equals(that._cidrs) && Objects.equals(_prefixListId, that._prefixListId) && _prefixListName.equals(that._prefixListName); } PrefixList(String prefixListId, List<Prefix> cidrs, String prefixListName); @Nonnull List<Prefix> getCidrs(); @Override String getId(); @Nonnull String getPrefixListName(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }