@Test public void testEquals() { new EqualsTester() .addEqualityGroup(new Condition("name", Function.EQUALS, Atom.string("name1")), new Condition("name", Function.EQUALS, new Atom<>("name1"))) .testEquals(); }
@Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof Condition)) { return false; } Condition condition = (Condition) other; return Objects.equals(column, condition.getColumn()) && function == condition.getFunction() && Objects.equals(value, condition.getValue()); }
Condition { @Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof Condition)) { return false; } Condition condition = (Condition) other; return Objects.equals(column, condition.getColumn()) && function == condition.getFunction() && Objects.equals(value, condition.getValue()); } }
Condition { @Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof Condition)) { return false; } Condition condition = (Condition) other; return Objects.equals(column, condition.getColumn()) && function == condition.getFunction() && Objects.equals(value, condition.getValue()); } Condition(String column, Function function, Value value); }
Condition { @Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof Condition)) { return false; } Condition condition = (Condition) other; return Objects.equals(column, condition.getColumn()) && function == condition.getFunction() && Objects.equals(value, condition.getValue()); } Condition(String column, Function function, Value value); String getColumn(); Function getFunction(); Object getValue(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); }
Condition { @Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof Condition)) { return false; } Condition condition = (Condition) other; return Objects.equals(column, condition.getColumn()) && function == condition.getFunction() && Objects.equals(value, condition.getValue()); } Condition(String column, Function function, Value value); String getColumn(); Function getFunction(); Object getValue(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString();  }