@Test public void testEquals() { PacketPolicy p = new PacketPolicy("name", ImmutableList.of(new Return(Drop.instance())), _defaultAction); new EqualsTester() .addEqualityGroup( p, p, new PacketPolicy("name", ImmutableList.of(new Return(Drop.instance())), _defaultAction)) .addEqualityGroup( new PacketPolicy( "otherName", ImmutableList.of(new Return(Drop.instance())), _defaultAction)) .addEqualityGroup(new PacketPolicy("name", ImmutableList.of(), _defaultAction)) .addEqualityGroup(new PacketPolicy("name", ImmutableList.of(), new Return(Drop.instance()))) .addEqualityGroup(new Object()) .testEquals(); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PacketPolicy that = (PacketPolicy) o; return Objects.equals(getStatements(), that.getStatements()) && Objects.equals(getName(), that.getName()) && Objects.equals(getDefaultAction(), that.getDefaultAction()); }
PacketPolicy implements Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PacketPolicy that = (PacketPolicy) o; return Objects.equals(getStatements(), that.getStatements()) && Objects.equals(getName(), that.getName()) && Objects.equals(getDefaultAction(), that.getDefaultAction()); } }
PacketPolicy implements Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PacketPolicy that = (PacketPolicy) o; return Objects.equals(getStatements(), that.getStatements()) && Objects.equals(getName(), that.getName()) && Objects.equals(getDefaultAction(), that.getDefaultAction()); } PacketPolicy(String name, List<Statement> statements, Return defaultAction); }
PacketPolicy implements Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PacketPolicy that = (PacketPolicy) o; return Objects.equals(getStatements(), that.getStatements()) && Objects.equals(getName(), that.getName()) && Objects.equals(getDefaultAction(), that.getDefaultAction()); } PacketPolicy(String name, List<Statement> statements, Return defaultAction); @Nonnull @JsonProperty(PROP_NAME) String getName(); @Nonnull @JsonProperty(PROP_STATEMENTS) List<Statement> getStatements(); @Nonnull @JsonProperty(PROP_DEFAULT_ACTION) Return getDefaultAction(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
PacketPolicy implements Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PacketPolicy that = (PacketPolicy) o; return Objects.equals(getStatements(), that.getStatements()) && Objects.equals(getName(), that.getName()) && Objects.equals(getDefaultAction(), that.getDefaultAction()); } PacketPolicy(String name, List<Statement> statements, Return defaultAction); @Nonnull @JsonProperty(PROP_NAME) String getName(); @Nonnull @JsonProperty(PROP_STATEMENTS) List<Statement> getStatements(); @Nonnull @JsonProperty(PROP_DEFAULT_ACTION) Return getDefaultAction(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }