public Pattern<T> matching(Predicate<? super T> predicate) { return matching((t, context) -> predicate.test(t)); }
public PruneJoinColumns() { super(join().matching(not(JoinNode::isCrossJoin))); }
public PruneJoinColumns() { super(join().matching(not(JoinNode::isCrossJoin))); }
public PruneCrossJoinColumns() { super(join().matching(JoinNode::isCrossJoin)); }
public PruneCrossJoinColumns() { super(join().matching(JoinNode::isCrossJoin)); }
implements Rule<JoinNode> private static final Pattern<JoinNode> PATTERN = join().matching(node -> node.getCriteria().isEmpty() && node.getFilter().isPresent() && node.getType() == LEFT);
implements Rule<JoinNode> private static final Pattern<JoinNode> PATTERN = join().matching(node -> node.getCriteria().isEmpty() && node.getFilter().isPresent() && node.getType() == LEFT);
@Test public void trivialMatchers() { //any assertMatch(any(), 42); assertMatch(any(), "John Doe"); //class based assertMatch(typeOf(Integer.class), 42); assertMatch(typeOf(Number.class), 42); assertNoMatch(typeOf(Integer.class), "John Doe"); //predicate-based assertMatch(typeOf(Integer.class).matching(x -> x > 0), 42); assertNoMatch(typeOf(Integer.class).matching(x -> x > 0), -1); }