Package com.helger.commons.functional
Interface IPredicate<T>
-
- Type Parameters:
T- the type of the input to the predicate
- All Superinterfaces:
Predicate<T>,Serializable
- All Known Subinterfaces:
IFileFilter
- 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 IPredicate<T> extends Predicate<T>, Serializable
Represents a predicate (boolean-valued function) of one argument that is serializable.This is a functional interface whose functional method is
Predicate.test(Object).- Since:
- 8.6.3
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description static <DATATYPE> IPredicate<DATATYPE>all()static <DATATYPE> IPredicate<DATATYPE>and(Predicate<? super DATATYPE> aFirst, Predicate<? super DATATYPE> aSecond)default IPredicate<T>and(Predicate<? super T> other)Returns a composed predicate that represents a short-circuiting logical AND of this predicate and another.static <T> IPredicate<T>isEqual(Object aCmpTo)Returns a predicate that tests if two arguments are equal according toObjects.equals(Object, Object).static <DATATYPE> IPredicate<DATATYPE>isNull()default IPredicate<T>negate()Returns a predicate that represents the logical negation of this predicate.static <DATATYPE> IPredicate<DATATYPE>none()static <DATATYPE> IPredicate<DATATYPE>notNull()static <DATATYPE> IPredicate<DATATYPE>or(Predicate<? super DATATYPE> aFirst, Predicate<? super DATATYPE> aSecond)default IPredicate<T>or(Predicate<? super T> other)Returns a composed predicate that represents a short-circuiting logical OR of this predicate and another.
-
-
-
Method Detail
-
and
@Nonnull default IPredicate<T> and(@Nullable Predicate<? super T> other)
Returns a composed predicate that represents a short-circuiting logical AND of this predicate and another. When evaluating the composed predicate, if this predicate isfalse, then theotherpredicate 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
otherpredicate will not be evaluated.
-
or
@Nonnull default IPredicate<T> or(@Nullable Predicate<? super T> other)
Returns a composed predicate that represents a short-circuiting logical OR of this predicate and another. When evaluating the composed predicate, if this predicate istrue, then theotherpredicate 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
otherpredicate will not be evaluated.
-
negate
@Nonnull default IPredicate<T> negate()
Returns a predicate that represents the logical negation of this predicate.
-
all
@Nonnull static <DATATYPE> IPredicate<DATATYPE> all()
-
none
@Nonnull static <DATATYPE> IPredicate<DATATYPE> none()
-
notNull
@Nonnull static <DATATYPE> IPredicate<DATATYPE> notNull()
-
isNull
@Nonnull static <DATATYPE> IPredicate<DATATYPE> isNull()
-
and
@Nullable static <DATATYPE> IPredicate<DATATYPE> and(@Nullable Predicate<? super DATATYPE> aFirst, @Nullable Predicate<? super DATATYPE> aSecond)
-
or
@Nullable static <DATATYPE> IPredicate<DATATYPE> or(@Nullable Predicate<? super DATATYPE> aFirst, @Nullable Predicate<? super DATATYPE> aSecond)
-
isEqual
@Nonnull static <T> IPredicate<T> isEqual(@Nullable Object aCmpTo)
Returns a predicate that tests if two arguments are equal according toObjects.equals(Object, Object).- Type Parameters:
T- the type of arguments to the predicate- Parameters:
aCmpTo- 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)
-
-