Predicate: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 22: Line 22:


=Composition Methods=
=Composition Methods=
The precedence of methods <tt>and()</tt> and <tt>or()</tt> is managed from left to right using their positions in the chain.


* [https://docs.oracle.com/javase/10/docs/api/java/util/function/Predicate.html#negate() negate()]
* [https://docs.oracle.com/javase/10/docs/api/java/util/function/Predicate.html#negate() negate()]
* [https://docs.oracle.com/javase/10/docs/api/java/util/function/Predicate.html#and(java.util.function.Predicate) and(Predicate)]
* [https://docs.oracle.com/javase/10/docs/api/java/util/function/Predicate.html#and(java.util.function.Predicate) and(Predicate)]
* [https://docs.oracle.com/javase/10/docs/api/java/util/function/Predicate.html#or(java.util.function.Predicate) or(Predicate)]
* [https://docs.oracle.com/javase/10/docs/api/java/util/function/Predicate.html#or(java.util.function.Predicate) or(Predicate)]

Revision as of 19:23, 26 March 2018

External

Internal

Overview

A predicate is a function that evaluates an argument and returns a boolean.

@FunctionalInterface
public interface Predicate<T> {

    boolean test(T t);

    ...
}

Composition Methods

The precedence of methods and() and or() is managed from left to right using their positions in the chain.