Class Predicates2<T,P>
- java.lang.Object
-
- org.eclipse.collections.impl.block.factory.Predicates2<T,P>
-
- All Implemented Interfaces:
Serializable,BiPredicate<T,P>,Predicate2<T,P>
public abstract class Predicates2<T,P> extends Object implements Predicate2<T,P>
Predicates2 is a static version of Predicates. All of its values are statically initialized, except for and, or, not and all the attribute combination methods. Predicates2 can only work with one parameter, so it is limited to handling only conditions of a simple nature.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Predicates2()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Predicates2<Object,Object>alwaysFalse()static Predicates2<Object,Object>alwaysTrue()Predicates2<T,P>and(Predicate2<? super T,? super P> op)static <T,P>
Predicates2<T,P>and(Predicate2<? super T,? super P> left, Predicate2<? super T,? super P> right)static <T> Predicates2<T,Object>attributeEqual(Function<? super T,?> function)static <T,P extends Comparable<? super P>>
Predicates2<T,P>attributeGreaterThan(Function<? super T,? extends P> function)static <T,P extends Comparable<? super P>>
Predicates2<T,P>attributeGreaterThanOrEqualTo(Function<? super T,? extends P> function)static <T> Predicates2<T,Iterable<?>>attributeIn(Function<T,?> function)static <T,P extends Comparable<? super P>>
Predicates2<T,P>attributeLessThan(Function<? super T,? extends P> function)static <T,P extends Comparable<? super P>>
Predicates2<T,P>attributeLessThanOrEqualTo(Function<? super T,? extends P> function)static <T> Predicates2<T,Object>attributeNotEqual(Function<? super T,?> function)static <T> Predicates2<T,Iterable<?>>attributeNotIn(Function<T,?> function)static Predicates2<Object,Object>equal()static <T extends Comparable<T>>
Predicates2<T,T>greaterThan()static <T extends Comparable<T>>
Predicates2<T,T>greaterThanOrEqualTo()static Predicates2<Object,Iterable<?>>in()static Predicates2<Object,Class<?>>instanceOf()static Predicates2<Object,Object>isNull()static <T extends Comparable<T>>
Predicates2<T,T>lessThan()static <T extends Comparable<T>>
Predicates2<T,T>lessThanOrEqualTo()static <T,P>
Predicates2<T,P>not(Predicate2<T,P> predicate)static Predicates2<Object,Object>notEqual()static Predicates2<Object,Iterable<?>>notIn()static Predicates2<Object,Class<?>>notInstanceOf()static Predicates2<Object,Object>notNull()static Predicates2<Object,Object>notSameAs()Predicates2<T,P>or(Predicate2<? super T,? super P> op)static <T,P>
Predicates2<T,P>or(Predicate2<? super T,? super P> left, Predicate2<? super T,? super P> right)static Predicates2<Object,Object>sameAs()static <T,P>
Predicate2<T,P>throwing(ThrowingPredicate2<T,P> throwingPredicate2)Allows a lambda or anonymous inner class that needs to throw a checked exception to be safely wrapped as a Predicate2 that will throw a RuntimeException, wrapping the checked exception that is the cause.static <T1,T2>
Predicate2<T1,T2>throwing(ThrowingPredicate2<T1,T2> throwingPredicate2, Function3<T1,T2,? super Throwable,? extends RuntimeException> rethrow)Allows a lambda or anonymous inner class that needs to throw a checked exception to be safely wrapped as a Procedure2 that will throw a user specified RuntimeException based on the provided function.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.function.BiPredicate
and, negate, or
-
Methods inherited from interface org.eclipse.collections.api.block.predicate.Predicate2
accept, test
-
-
-
-
Method Detail
-
and
public Predicates2<T,P> and(Predicate2<? super T,? super P> op)
-
or
public Predicates2<T,P> or(Predicate2<? super T,? super P> op)
-
throwing
public static <T,P> Predicate2<T,P> throwing(ThrowingPredicate2<T,P> throwingPredicate2)
Allows a lambda or anonymous inner class that needs to throw a checked exception to be safely wrapped as a Predicate2 that will throw a RuntimeException, wrapping the checked exception that is the cause.
-
throwing
public static <T1,T2> Predicate2<T1,T2> throwing(ThrowingPredicate2<T1,T2> throwingPredicate2, Function3<T1,T2,? super Throwable,? extends RuntimeException> rethrow)
Allows a lambda or anonymous inner class that needs to throw a checked exception to be safely wrapped as a Procedure2 that will throw a user specified RuntimeException based on the provided function. The function is passed the current element and the checked exception that was thrown as context arguments.
-
not
public static <T,P> Predicates2<T,P> not(Predicate2<T,P> predicate)
-
or
public static <T,P> Predicates2<T,P> or(Predicate2<? super T,? super P> left, Predicate2<? super T,? super P> right)
-
and
public static <T,P> Predicates2<T,P> and(Predicate2<? super T,? super P> left, Predicate2<? super T,? super P> right)
-
attributeIn
public static <T> Predicates2<T,Iterable<?>> attributeIn(Function<T,?> function)
-
attributeNotIn
public static <T> Predicates2<T,Iterable<?>> attributeNotIn(Function<T,?> function)
-
alwaysTrue
public static Predicates2<Object,Object> alwaysTrue()
-
alwaysFalse
public static Predicates2<Object,Object> alwaysFalse()
-
isNull
public static Predicates2<Object,Object> isNull()
-
notNull
public static Predicates2<Object,Object> notNull()
-
equal
public static Predicates2<Object,Object> equal()
-
notEqual
public static Predicates2<Object,Object> notEqual()
-
in
public static Predicates2<Object,Iterable<?>> in()
-
notIn
public static Predicates2<Object,Iterable<?>> notIn()
-
lessThan
public static <T extends Comparable<T>> Predicates2<T,T> lessThan()
-
lessThanOrEqualTo
public static <T extends Comparable<T>> Predicates2<T,T> lessThanOrEqualTo()
-
greaterThan
public static <T extends Comparable<T>> Predicates2<T,T> greaterThan()
-
sameAs
public static Predicates2<Object,Object> sameAs()
-
notSameAs
public static Predicates2<Object,Object> notSameAs()
-
instanceOf
public static Predicates2<Object,Class<?>> instanceOf()
-
notInstanceOf
public static Predicates2<Object,Class<?>> notInstanceOf()
-
greaterThanOrEqualTo
public static <T extends Comparable<T>> Predicates2<T,T> greaterThanOrEqualTo()
-
attributeNotEqual
public static <T> Predicates2<T,Object> attributeNotEqual(Function<? super T,?> function)
-
attributeLessThan
public static <T,P extends Comparable<? super P>> Predicates2<T,P> attributeLessThan(Function<? super T,? extends P> function)
-
attributeLessThanOrEqualTo
public static <T,P extends Comparable<? super P>> Predicates2<T,P> attributeLessThanOrEqualTo(Function<? super T,? extends P> function)
-
attributeGreaterThan
public static <T,P extends Comparable<? super P>> Predicates2<T,P> attributeGreaterThan(Function<? super T,? extends P> function)
-
attributeGreaterThanOrEqualTo
public static <T,P extends Comparable<? super P>> Predicates2<T,P> attributeGreaterThanOrEqualTo(Function<? super T,? extends P> function)
-
attributeEqual
public static <T> Predicates2<T,Object> attributeEqual(Function<? super T,?> function)
-
-