Package io.deephaven.function
Interface ToBooleanFunction<T>
- Type Parameters:
T- the input type
- All Superinterfaces:
Predicate<T>,ToPrimitiveFunction<T>,TypedFunction<T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface ToBooleanFunction<T>
extends ToPrimitiveFunction<T>, Predicate<T>
A
boolean function.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.function.ToPrimitiveFunction
ToPrimitiveFunction.Visitor<T,R> -
Method Summary
Modifier and TypeMethodDescriptiondefault @NotNull ToBooleanFunction<T>static <T> ToBooleanFunction<T>and(Collection<Predicate<? super T>> functions) Creates a function that returnstrueif all functions infunctionsreturnstrue.static <T> ToBooleanFunction<T>cast()Assumes the object value is directly castable to a boolean.static <T,R> ToBooleanFunction<T> Creates the function compositiong ∘ f.default @NotNull ToBooleanFunction<T>negate()static <T> ToBooleanFunction<T>Creates a function that is the opposite off.static <T> ToBooleanFunction<T>ofFalse()A function that always returnsfalse.static <T> ToBooleanFunction<T>ofTrue()A function that always returnstrue.default @NotNull ToBooleanFunction<T>static <T> ToBooleanFunction<T>or(Collection<Predicate<? super T>> functions) Creates a function that returnstrueif any function infunctionsreturnstrue.default BooleanTypeThis function's return type.booleandefault <R> Rwalk(ToPrimitiveFunction.Visitor<T, R> visitor) Methods inherited from interface io.deephaven.function.ToPrimitiveFunction
walk
-
Method Details
-
cast
Assumes the object value is directly castable to a boolean. Equivalent tox -> (boolean)x.- Type Parameters:
T- the value type- Returns:
- the boolean function
-
ofTrue
A function that always returnstrue.- Type Parameters:
T- the input type- Returns:
- the true function
-
ofFalse
A function that always returnsfalse.- Type Parameters:
T- the input type- Returns:
- the false function
-
map
Creates the function compositiong ∘ f.Equivalent to
x -> g.test(f.apply(x)).- Type Parameters:
T- the input typeR- the intermediate type- Parameters:
f- the inner functiong- the outer function- Returns:
- the boolean function
-
or
Creates a function that returnstrueif any function infunctionsreturnstrue. Iffunctionsis empty, returnsofFalse().- Type Parameters:
T- the input type- Parameters:
functions- the functions- Returns:
- the or-function
-
and
Creates a function that returnstrueif all functions infunctionsreturnstrue. Iffunctionsis empty, returnsofTrue().- Type Parameters:
T- the input type- Parameters:
functions- the functions- Returns:
- the and-function
-
not
Creates a function that is the opposite off. Equivalent tox -> !f.test(x).- Type Parameters:
T- the input type- Parameters:
f- the function- Returns:
- the not-function
-
test
-
returnType
Description copied from interface:TypedFunctionThis function's return type.- Specified by:
returnTypein interfaceToPrimitiveFunction<T>- Specified by:
returnTypein interfaceTypedFunction<T>- Returns:
- the type
-
walk
- Specified by:
walkin interfaceToPrimitiveFunction<T>
-
negate
-
and
-
or
-