@Test public void testEquals() { new EqualsTester() .addEqualityGroup( new IspFilter(ImmutableList.of(1234L), ImmutableList.of(Ip.parse("1.1.1.1"))), new IspFilter(ImmutableList.of(1234L), ImmutableList.of(Ip.parse("1.1.1.1")))) .addEqualityGroup( new IspFilter(ImmutableList.of(1234L), ImmutableList.of(Ip.parse("2.2.2.2")))) .addEqualityGroup( new IspFilter(ImmutableList.of(5678L), ImmutableList.of(Ip.parse("1.1.1.1")))) .testEquals(); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof IspFilter)) { return false; } IspFilter ispFilter = (IspFilter) o; return Objects.equals(_onlyRemoteAsns, ispFilter._onlyRemoteAsns) && Objects.equals(_onlyRemoteIps, ispFilter._onlyRemoteIps); }
IspFilter { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof IspFilter)) { return false; } IspFilter ispFilter = (IspFilter) o; return Objects.equals(_onlyRemoteAsns, ispFilter._onlyRemoteAsns) && Objects.equals(_onlyRemoteIps, ispFilter._onlyRemoteIps); } }
IspFilter { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof IspFilter)) { return false; } IspFilter ispFilter = (IspFilter) o; return Objects.equals(_onlyRemoteAsns, ispFilter._onlyRemoteAsns) && Objects.equals(_onlyRemoteIps, ispFilter._onlyRemoteIps); } IspFilter(@Nonnull List<Long> onlyRemoteAsns, @Nonnull List<Ip> onlyRemoteIps); }
IspFilter { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof IspFilter)) { return false; } IspFilter ispFilter = (IspFilter) o; return Objects.equals(_onlyRemoteAsns, ispFilter._onlyRemoteAsns) && Objects.equals(_onlyRemoteIps, ispFilter._onlyRemoteIps); } IspFilter(@Nonnull List<Long> onlyRemoteAsns, @Nonnull List<Ip> onlyRemoteIps); @Override boolean equals(Object o); @Override int hashCode(); @JsonProperty(PROP_ONLY_REMOTE_ASNS) @Nonnull List<Long> getOnlyRemoteAsns(); @JsonProperty(PROP_ONLY_REMOTE_IPS) @Nonnull List<Ip> getOnlyRemoteIps(); }
IspFilter { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof IspFilter)) { return false; } IspFilter ispFilter = (IspFilter) o; return Objects.equals(_onlyRemoteAsns, ispFilter._onlyRemoteAsns) && Objects.equals(_onlyRemoteIps, ispFilter._onlyRemoteIps); } IspFilter(@Nonnull List<Long> onlyRemoteAsns, @Nonnull List<Ip> onlyRemoteIps); @Override boolean equals(Object o); @Override int hashCode(); @JsonProperty(PROP_ONLY_REMOTE_ASNS) @Nonnull List<Long> getOnlyRemoteAsns(); @JsonProperty(PROP_ONLY_REMOTE_IPS) @Nonnull List<Ip> getOnlyRemoteIps(); static final IspFilter ALLOW_ALL; }