T - The type of the operands and result of the operator@FunctionalInterface public interface TernaryOperator<T> extends TriFunction<T,T,T,T>
TriFunction for the case where the operands and the result are all of
the same type.
This is a functional interface whose functional method is
TriFunction.apply(Object, Object, Object).
TriFunction,
UnaryOperator| Modifier and Type | Method and Description |
|---|---|
static <T> TernaryOperator<T> |
conditional(java.util.function.Predicate<? super T> predicate)
Returns an operator which returns either the second or third argument based
on whether the
predicate returns true or false on the
first argument respectively. |
andThen, applystatic <T> TernaryOperator<T> conditional(java.util.function.Predicate<? super T> predicate)
predicate returns true or false on the
first argument respectively.T - The type of the input argument of the predicatepredicate - A Predicate for testing a specific valuepredicate.java.lang.NullPointerException - If the predicate is null