On this page

FailablePredicate

@FunctionalInterface public interface org.apache.commons.lang3.function.FailablePredicate<T, E extends Throwable>[source]

A functional interface like Predicate that declares a Throwable.

Type parameters:
  • <T> – Predicate type.

  • <E> – The kind of thrown exception or error.

Since:

3.11

Fields and constants

static final FailablePredicate

FALSE

FALSE singleton

static final FailablePredicate

TRUE

TRUE singleton

static final FailablePredicate FALSE[source]

FALSE singleton

static final FailablePredicate TRUE[source]

TRUE singleton

Methods

default FailablePredicate<T, E>

and(FailablePredicate<? super T, E> other)

Returns a composed FailablePredicate like Predicate.and(Predicate).

static <T, E extends Throwable> FailablePredicate<T, E>

falsePredicate()

Gets the FALSE singleton.

default FailablePredicate<T, E>

negate()

Returns a predicate that negates this predicate.

default FailablePredicate<T, E>

or(FailablePredicate<? super T, E> other)

Returns a composed FailablePredicate like Predicate.and(Predicate).

boolean

test(T object)

Tests the predicate.

static <T, E extends Throwable> FailablePredicate<T, E>

truePredicate()

Gets the TRUE singleton.

default FailablePredicate<T, E> and(FailablePredicate<? super T, E> other)[source]

Returns a composed FailablePredicate like Predicate.and(Predicate).

Parameters:

other – A predicate that will be logically-ANDed with this predicate.

Returns:

A composed FailablePredicate like Predicate.and(Predicate).

Throws:

NullPointerException – Thrown if other is null.

static <T, E extends Throwable> FailablePredicate<T, E> falsePredicate()[source]

Gets the FALSE singleton.

Type parameters:
  • <T> – Predicate type.

  • <E> – The kind of thrown exception or error.

Returns:

The NOP singleton.

default FailablePredicate<T, E> negate()[source]

Returns a predicate that negates this predicate.

Returns:

A predicate that negates this predicate.

default FailablePredicate<T, E> or(FailablePredicate<? super T, E> other)[source]

Returns a composed FailablePredicate like Predicate.and(Predicate).

Parameters:

other – A predicate that will be logically-ORed with this predicate.

Returns:

A composed FailablePredicate like Predicate.and(Predicate).

Throws:

NullPointerException – Thrown if other is null.

boolean test(T object) throws E[source]

Tests the predicate.

Parameters:

object – The object to test the predicate on

Returns:

The predicate's evaluation

Throws:

E – Thrown if the predicate fails.

static <T, E extends Throwable> FailablePredicate<T, E> truePredicate()[source]

Gets the TRUE singleton.

Type parameters:
  • <T> – Predicate type.

  • <E> – The kind of thrown exception or error.

Returns:

The NOP singleton.