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>
- Direct Known Subclasses:
Predicates2.AlwaysFalse
,Predicates2.AlwaysTrue
,Predicates2.And
,Predicates2.AttributePredicates2
,Predicates2.Equal
,Predicates2.GreaterThan
,Predicates2.GreaterThanOrEqual
,Predicates2.In
,Predicates2.IsIdentical
,Predicates2.IsInstanceOf
,Predicates2.IsNull
,Predicates2.LessThan
,Predicates2.LessThanOrEqual
,Predicates2.Not
,Predicates2.NotEqual
,Predicates2.NotIdentitical
,Predicates2.NotIn
,Predicates2.NotInstanceOf
,Predicates2.NotNull
,Predicates2.Or
,StringPredicates2.ContainsString
,StringPredicates2.EndsWith
,StringPredicates2.EqualsIgnoreCase
,StringPredicates2.MatchesRegex
,StringPredicates2.NotContainsString
,StringPredicates2.NotEndsWith
,StringPredicates2.NotEqualsIgnoreCase
,StringPredicates2.NotStartsWith
,StringPredicates2.StartsWith
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
private static final class
private static final class
private static final class
private static final class
private static class
Predicates2.GreaterThan<T extends Comparable<T>>
private static class
Predicates2.GreaterThanOrEqual<T extends Comparable<T>>
private static final class
private static final class
private static final class
private static final class
private static class
Predicates2.LessThan<T extends Comparable<T>>
private static class
Predicates2.LessThanOrEqual<T extends Comparable<T>>
private static final class
private static final class
private static final class
private static final class
private static final class
private static final class
private static final class
private static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Predicates2
<Object, Object> private static final Predicates2
<Object, Object> private static final Predicates2
<Object, Object> private static final Predicates2
<?, ?> private static final Predicates2
<?, ?> private static final Predicates2
<Object, Iterable<?>> private static final Predicates2
<Object, Class<?>> private static final Predicates2
<Object, Object> private static final Predicates2
<Object, Object> private static final Predicates2
<?, ?> private static final Predicates2
<?, ?> private static final Predicates2
<Object, Object> private static final Predicates2
<Object, Object> private static final Predicates2
<Object, Iterable<?>> private static final Predicates2
<Object, Class<?>> private static final Predicates2
<Object, Object> private static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Predicates2
<Object, Object> static Predicates2
<Object, Object> 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> static <T extends Comparable<T>>
Predicates2<T, T> static Predicates2
<Object, Iterable<?>> in()
static Predicates2
<Object, Class<?>> static Predicates2
<Object, Object> isNull()
static <T extends Comparable<T>>
Predicates2<T, T> lessThan()
static <T extends Comparable<T>>
Predicates2<T, T> 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<?>> static Predicates2
<Object, Object> notNull()
static Predicates2
<Object, Object> 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
clone, equals, finalize, 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
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
NOT_EQUAL
-
IN
-
EQUAL
-
NOT_IN
-
LESS_THAN
-
LESS_THAN_OR_EQUAL
-
GREATER_THAN
-
GREATER_THAN_OR_EQUAL
-
INSTANCE_OF
-
IS_IDENTICAL
-
NOT_IDENTITICAL
-
NOT_INSTANCE_OF
-
ALWAYS_TRUE
-
ALWAYS_FALSE
-
IS_NULL
-
NOT_NULL
-
-
Constructor Details
-
Predicates2
public Predicates2()
-
-
Method Details
-
and
-
or
-
throwing
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
-
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
-
attributeNotIn
-
alwaysTrue
-
alwaysFalse
-
isNull
-
notNull
-
equal
-
notEqual
-
in
-
notIn
-
lessThan
-
lessThanOrEqualTo
-
greaterThan
-
sameAs
-
notSameAs
-
instanceOf
-
notInstanceOf
-
greaterThanOrEqualTo
-
attributeNotEqual
-
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
-