Top Description Methods
io.vavr

public Interface CheckedPredicate<T>

Additional top-level class in compilation unit: CheckedPredicateModule.

Annotations
@FunctionalInterface
Type Parameters
<T>
the type of the input to the predicate
Imports
java.util.function.Predicate

A java.util.function.Predicate which may throw.

Method Summary

Modifier and TypeMethod and Description
public default CheckedPredicate<T>

Returns:

A new CheckedPredicate.
negate
()

Negates this predicate.

public static <
type of values that are tested by the predicate
T
>
CheckedPredicate<T>

Returns:

a new CheckedPredicate
of
(CheckedPredicate<T>
(typically) a method reference, e.g. Type::method
methodReference
)

Creates a CheckedPredicate.

public boolean

Returns:

true if the input argument matches the predicate, otherwise false
test
(T
the input argument
t
)

Evaluates this predicate on the given argument.

public default Predicate<T>

Returns:

a new Predicate that throws a Throwable.
unchecked
()

Returns an unchecked Predicate that will sneaky throw if an exceptions occurs when testing a value.

Method Detail

negateback to summary
public default CheckedPredicate<T> negate()

Negates this predicate.

Returns:CheckedPredicate<T>

A new CheckedPredicate.

ofback to summary
public static <T> CheckedPredicate<T> of(CheckedPredicate<T> methodReference)

Creates a CheckedPredicate.

final CheckedPredicate<Boolean> checkedPredicate = CheckedPredicate.of(Boolean::booleanValue);
final Predicate<Boolean> predicate = checkedPredicate.unchecked();

// = true
predicate.test(Boolean.TRUE);

// throws
predicate.test(null);
Parameters
<T>
type of values that are tested by the predicate
methodReference:CheckedPredicate<T>

(typically) a method reference, e.g. Type::method

Returns:CheckedPredicate<T>

a new CheckedPredicate

See Also
CheckedFunction1#of(CheckedFunction1)
testback to summary
public boolean test(T t) throws Throwable

Evaluates this predicate on the given argument.

Parameters
t:T

the input argument

Returns:boolean

true if the input argument matches the predicate, otherwise false

Exceptions
Throwable:
if an error occurs
uncheckedback to summary
public default Predicate<T> unchecked()

Returns an unchecked Predicate that will sneaky throw if an exceptions occurs when testing a value.

Returns:Predicate<T>

a new Predicate that throws a Throwable.