T
- The type of the input to the predicate.@FunctionalInterface public interface IOPredicate<T>
IOException
throwing equivalent of Predicate
.Modifier and Type | Method and Description |
---|---|
default IOPredicate<T> |
and(IOPredicate<? super T> other)
Returns a composed predicate that represents a short-circuiting logical AND of this predicate and another.
|
static <T> IOPredicate<T> |
checked(Predicate<? super T> predicate)
Returns a predicate that evaluates the
predicate predicate, and unwraps any UncheckedIOException that is thrown by
throwing its cause . |
static <T> IOPredicate<T> |
isEqual(Object targetRef)
Returns a predicate that tests if two arguments are equal according to
Objects.equals(Object, Object) . |
default IOPredicate<T> |
negate()
Returns a predicate that represents the logical negation of this predicate.
|
static <T> IOPredicate<T> |
not(IOPredicate<? super T> target)
Returns a predicate that represents the logical negation of another predicate.
|
default IOPredicate<T> |
or(IOPredicate<? super T> other)
Returns a composed predicate that represents a short-circuiting logical OR of this predicate and another.
|
boolean |
test(T t)
Evaluates this predicate on the given argument.
|
static <T> Predicate<T> |
unchecked(IOPredicate<? super T> predicate)
Returns a predicate that evaluates the
predicate predicate, and wraps any IOException that is thrown in an
UncheckedIOException . |
boolean test(T t) throws IOException
t
- The input argument.true
if the input argument matches the predicate, otherwise false
.IOException
- If an I/O error occurs.default IOPredicate<T> and(IOPredicate<? super T> other)
false
, then the other
predicate is not evaluated.
Any exceptions thrown during evaluation of either predicate are relayed to the caller;
if evaluation of this predicate throws an exception, the other
predicate will not be evaluated.
other
- A predicate that will be logically-ANDed with this predicate.other
predicate.NullPointerException
- If other
is null
.default IOPredicate<T> negate()
default IOPredicate<T> or(IOPredicate<? super T> other)
true
, then the other
predicate is not evaluated.
Any exceptions thrown during evaluation of either predicate are relayed to the caller;
if evaluation of this predicate throws an exception, the other
predicate will not be evaluated.
other
- A predicate that will be logically-ORed with this predicateother
predicate.NullPointerException
- If other
is null
.static <T> IOPredicate<T> isEqual(Object targetRef)
Objects.equals(Object, Object)
.T
- The type of arguments to the predicate.targetRef
- The object reference with which to compare for equality, which may be null
.Objects.equals(Object, Object)
.static <T> Predicate<T> unchecked(IOPredicate<? super T> predicate)
predicate
predicate, and wraps any IOException
that is thrown in an
UncheckedIOException
.T
- The type of arguments to the predicate.predicate
- The predicate to evaluate when the returned predicate is evaluated.predicate
predicate on its input, and wraps any IOException
that is thrown in an
UncheckedIOException
.NullPointerException
- If predicate
is null
.static <T> IOPredicate<T> checked(Predicate<? super T> predicate)
predicate
predicate, and unwraps any UncheckedIOException
that is thrown by
throwing its cause
.T
- The type of arguments to the predicate.predicate
- The predicate to evaluate when the returned predicate is evaluated.predicate
operation on its input, and unwraps any UncheckedIOException
that is thrown.NullPointerException
- If the given operation is null
.static <T> IOPredicate<T> not(IOPredicate<? super T> target)
target.negate()
.T
- The type of the argument to the predicate.target
- The predicate to negate.NullPointerException
- If the given predicate is null
.Copyright © 2017–2020. All rights reserved.