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 returnstrue
if all functions infunctions
returnstrue
.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 returnstrue
if any function infunctions
returnstrue
.default BooleanType
This function's return type.boolean
default <R> R
walk
(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 returnstrue
if any function infunctions
returnstrue
. Iffunctions
is empty, returnsofFalse()
.- Type Parameters:
T
- the input type- Parameters:
functions
- the functions- Returns:
- the or-function
-
and
Creates a function that returnstrue
if all functions infunctions
returnstrue
. Iffunctions
is 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:TypedFunction
This function's return type.- Specified by:
returnType
in interfaceToPrimitiveFunction<T>
- Specified by:
returnType
in interfaceTypedFunction<T>
- Returns:
- the type
-
walk
- Specified by:
walk
in interfaceToPrimitiveFunction<T>
-
negate
-
and
-
or
-