@Test public void testEquals() { new EqualsTester() .addEqualityGroup(new Object()) .addEqualityGroup(OBJ, OBJ, new IntComparison(IntComparator.EQ, new LiteralInt(1))) .addEqualityGroup(new IntComparison(IntComparator.GT, new LiteralInt(1))) .addEqualityGroup(new IntComparison(IntComparator.GT, new LiteralInt(2))) .testEquals(); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof IntComparison)) { return false; } IntComparison rhs = (IntComparison) obj; return _comparator == rhs._comparator && _expr.equals(rhs._expr); }
IntComparison extends IntMatchExpr { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof IntComparison)) { return false; } IntComparison rhs = (IntComparison) obj; return _comparator == rhs._comparator && _expr.equals(rhs._expr); } }
IntComparison extends IntMatchExpr { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof IntComparison)) { return false; } IntComparison rhs = (IntComparison) obj; return _comparator == rhs._comparator && _expr.equals(rhs._expr); } IntComparison(IntComparator comparator, IntExpr expr); }
IntComparison extends IntMatchExpr { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof IntComparison)) { return false; } IntComparison rhs = (IntComparison) obj; return _comparator == rhs._comparator && _expr.equals(rhs._expr); } IntComparison(IntComparator comparator, IntExpr expr); @Override T accept(IntMatchExprVisitor<T, U> visitor, U arg); @JsonProperty(PROP_COMPARATOR) @Nonnull IntComparator getComparator(); @JsonProperty(PROP_EXPR) @Nonnull IntExpr getExpr(); @Override boolean equals(Object obj); @Override int hashCode(); }
IntComparison extends IntMatchExpr { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof IntComparison)) { return false; } IntComparison rhs = (IntComparison) obj; return _comparator == rhs._comparator && _expr.equals(rhs._expr); } IntComparison(IntComparator comparator, IntExpr expr); @Override T accept(IntMatchExprVisitor<T, U> visitor, U arg); @JsonProperty(PROP_COMPARATOR) @Nonnull IntComparator getComparator(); @JsonProperty(PROP_EXPR) @Nonnull IntExpr getExpr(); @Override boolean equals(Object obj); @Override int hashCode();  }