Package com.globalmentor.io.function
Interface IOPredicate<T>
-
- Type Parameters:
T
- the type of the input to the predicate
- 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 IOPredicate<T>
Represents a predicate (boolean-valued function) of one argument.This interface is similar to
Predicate
except that it is allowed to throw anIOException
.- Author:
- Magno N A Cruz
- See Also:
Predicate
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default IOPredicate<T>
and(IOPredicate<? super T> other)
This method is the same asPredicate.and(Predicate)
, but with a support forIOException
.static <T> IOPredicate<T>
isEqual(java.lang.Object targetRef)
This method is the same asPredicate.isEqual(Object)
, but with a support forIOException
.default IOPredicate<T>
negate()
This method is the same asPredicate.negate()
, but with a support forIOException
.default IOPredicate<T>
or(IOPredicate<? super T> other)
This method is the same asPredicate.or(Predicate)
, but with a support forIOException
.boolean
test(T t)
This method is the same asPredicate.test(Object)
, but with a support forIOException
.
-
-
-
Method Detail
-
test
boolean test(T t) throws java.io.IOException
This method is the same as
Predicate.test(Object)
, but with a support forIOException
.- Parameters:
t
- The input argument.- Returns:
true
if the input argument matches the predicate,false
if not.- Throws:
java.io.IOException
- if there is an I/O error performing the operation.
-
and
default IOPredicate<T> and(@Nonnull IOPredicate<? super T> other) throws java.io.IOException
This method is the same as
Predicate.and(Predicate)
, but with a support forIOException
.- Parameters:
other
- A predicate that will be logically-ANDed with this predicate.- Returns:
- A composed predicate that represents the short-circuiting logical AND of this predicate and the
other
predicate. - Throws:
java.io.IOException
- if there is an I/O error performing the operation.
-
negate
default IOPredicate<T> negate() throws java.io.IOException
This method is the same as
Predicate.negate()
, but with a support forIOException
.- Returns:
- A predicate that represents the logical negation of this predicate.
- Throws:
java.io.IOException
- if there is an I/O error performing the operation.
-
or
default IOPredicate<T> or(@Nonnull IOPredicate<? super T> other) throws java.io.IOException
This method is the same as
Predicate.or(Predicate)
, but with a support forIOException
.- Parameters:
other
- A predicate that will be logically-ORed with this predicate.- Returns:
- A composed predicate that represents the short-circuiting logical OR of this predicate and the
other
predicate. - Throws:
java.io.IOException
- if there is an I/O error performing the operation.
-
isEqual
static <T> IOPredicate<T> isEqual(java.lang.Object targetRef) throws java.io.IOException
This method is the same as
Predicate.isEqual(Object)
, but with a support forIOException
.- Type Parameters:
T
- The type of arguments to the predicate.- Parameters:
targetRef
- The object reference with which to compare for equality, which may benull
.- Returns:
- A predicate that tests if two arguments are equal according to
Objects.equals(Object, Object)
. - Throws:
java.io.IOException
- if there is an I/O error performing the operation.
-
-