Skip to content

Predicates

Rahul Chhabra edited this page Jun 13, 2017 · 1 revision

Predicates are special consumers that consume some objects and return their validity (user-defined) via a bool.

TriPredicate<Integer, Integer, Integer> triPredicate = (a, b, c) -> a == b && b == c;
triPredicate.test(5, 6, 7);
//will return false

The negate function returns a TriPredicate that returns the same boolean with a ! prefix,the negative of the boolean. The or function returns a TriPredicate which gives a logical "OR" of the TriPredicate it takes as an arg and the this. The and function returns a TriPredicate which gives a logical "AND" of the TriPredicate it takes as an arg and the this.

Clone this wiki locally