@Test public void testVisitIntMatchAll() { assertTrue(IntMatchAll.of().accept(IntMatchExprEvaluator.instance(), new LiteralInt(1))); assertTrue( IntMatchAll.of( new IntComparison(IntComparator.EQ, new LiteralInt(1)), new IntComparison(IntComparator.EQ, new LiteralInt(1))) .accept(IntMatchExprEvaluator.instance(), new LiteralInt(1))); assertFalse( IntMatchAll.of( new IntComparison(IntComparator.EQ, new LiteralInt(1)), new IntComparison(IntComparator.EQ, new LiteralInt(2))) .accept(IntMatchExprEvaluator.instance(), new LiteralInt(1))); }
@Override public @Nonnull Boolean visitIntMatchAll(IntMatchAll intMatchAll, IntExpr arg) { return intMatchAll.getExprs().stream().allMatch(expr -> expr.accept(this, arg)); }
IntMatchExprEvaluator implements IntMatchExprVisitor<Boolean, IntExpr> { @Override public @Nonnull Boolean visitIntMatchAll(IntMatchAll intMatchAll, IntExpr arg) { return intMatchAll.getExprs().stream().allMatch(expr -> expr.accept(this, arg)); } }
IntMatchExprEvaluator implements IntMatchExprVisitor<Boolean, IntExpr> { @Override public @Nonnull Boolean visitIntMatchAll(IntMatchAll intMatchAll, IntExpr arg) { return intMatchAll.getExprs().stream().allMatch(expr -> expr.accept(this, arg)); }  }
IntMatchExprEvaluator implements IntMatchExprVisitor<Boolean, IntExpr> { @Override public @Nonnull Boolean visitIntMatchAll(IntMatchAll intMatchAll, IntExpr arg) { return intMatchAll.getExprs().stream().allMatch(expr -> expr.accept(this, arg)); }  static @Nonnull IntMatchExprEvaluator instance(); @Override @Nonnull Boolean visitIntComparison(IntComparison intComparison, IntExpr arg); @Override @Nonnull Boolean visitIntMatchAll(IntMatchAll intMatchAll, IntExpr arg); }
IntMatchExprEvaluator implements IntMatchExprVisitor<Boolean, IntExpr> { @Override public @Nonnull Boolean visitIntMatchAll(IntMatchAll intMatchAll, IntExpr arg) { return intMatchAll.getExprs().stream().allMatch(expr -> expr.accept(this, arg)); }  static @Nonnull IntMatchExprEvaluator instance(); @Override @Nonnull Boolean visitIntComparison(IntComparison intComparison, IntExpr arg); @Override @Nonnull Boolean visitIntMatchAll(IntMatchAll intMatchAll, IntExpr arg);  }