Package org.apache.ignite.internal.util
Class F0
- java.lang.Object
-
- org.apache.ignite.internal.util.F0
-
public class F0 extends Object
Internal utility class that contains not peer-deployable predicates for use in internal logic.
-
-
Constructor Summary
Constructors Constructor Description F0()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> IgnitePredicate<T>and(@Nullable IgnitePredicate<? super T>[] p1, @Nullable IgnitePredicate<? super T>... p2)Get a predicate (non peer-deployable) that evaluates totrueif each of its component predicates evaluates totrue.static <T> IgnitePredicate<T>and(@Nullable IgnitePredicate<? super T> p, @Nullable IgnitePredicate<? super T>... ps)Get a predicate (not peer-deployable) that evaluates totrueif each of its component predicates evaluates totrue.static <K,V>
Map<K,V>asMap(K key, V val)Creates map with given values, adding a strict not-null check for value.static <T> IgnitePredicate<T>contains(@Nullable Collection<T> c)Provides predicate (not peer-deployable) which returnstrueif it receives an element that is contained in the passed in collection.static <T> IgnitePredicate<T>equalTo(T target)Gets predicate (not perr-deployable) that evaluates totrueif its free variable is equal totargetor both arenull.static <T> IgnitePredicate<T>in(@Nullable Collection<? extends T> c)Gets predicate (not peer-deployable) that returnstrueif its free variable is contained in given collection.static booleanisAllNodePredicates(@Nullable IgnitePredicate<?>... ps)Tests if all passed in predicates are instances ofGridNodePredicateclass.static <T> IgnitePredicate<T>not(@Nullable IgnitePredicate<? super T>... p)Negates given predicates.static <T> IgnitePredicate<T>notContains(@Nullable Collection<T> c)Provides predicate (not peer-deployable) which returnstrueif it receives an element that is not contained in the passed in collection.static <T> IgnitePredicate<T>notEqualTo(T target)Gets predicate (not peer-deployable) that evaluates totrueif its free variable is not equal totargetor both arenull.static <T> IgnitePredicate<T>notIn(@Nullable Collection<? extends T> c)Gets predicate (not peer-deployable) that returnstrueif its free variable is not contained in given collection.
-
-
-
Method Detail
-
not
public static <T> IgnitePredicate<T> not(@Nullable @Nullable IgnitePredicate<? super T>... p)
Negates given predicates.Gets predicate (not peer-deployable) that evaluates to
trueif any of given predicates evaluates tofalse. If all predicates evaluate totruethe result predicate will evaluate tofalse.- Type Parameters:
T- Type of the free variable, i.e. the element the predicate is called on.- Parameters:
p- Predicate to negate.- Returns:
- Negated predicate (not peer-deployable).
-
notEqualTo
public static <T> IgnitePredicate<T> notEqualTo(@Nullable T target)
Gets predicate (not peer-deployable) that evaluates totrueif its free variable is not equal totargetor both arenull.- Type Parameters:
T- Type of the free variable, i.e. the element the predicate is called on.- Parameters:
target- Object to compare free variable to.- Returns:
- Predicate (not peer-deployable) that evaluates to
trueif its free variable is not equal totargetor both arenull.
-
notIn
public static <T> IgnitePredicate<T> notIn(@Nullable @Nullable Collection<? extends T> c)
Gets predicate (not peer-deployable) that returnstrueif its free variable is not contained in given collection.- Type Parameters:
T- Type of the free variable for the predicate and type of the collection elements.- Parameters:
c- Collection to check for containment.- Returns:
- Predicate (not peer-deployable) that returns
trueif its free variable is not contained in given collection.
-
equalTo
public static <T> IgnitePredicate<T> equalTo(@Nullable T target)
Gets predicate (not perr-deployable) that evaluates totrueif its free variable is equal totargetor both arenull.- Type Parameters:
T- Type of the free variable, i.e. the element the predicate is called on.- Parameters:
target- Object to compare free variable to.- Returns:
- Predicate that evaluates to
trueif its free variable is equal totargetor both arenull.
-
and
public static <T> IgnitePredicate<T> and(@Nullable @Nullable IgnitePredicate<? super T>[] p1, @Nullable @Nullable IgnitePredicate<? super T>... p2)
Get a predicate (non peer-deployable) that evaluates totrueif each of its component predicates evaluates totrue. The components are evaluated in order they are supplied. Evaluation will be stopped as soon as first predicate evaluates tofalse. Passed in predicates are NOT copied. If no predicates are passed in the returned predicate will always evaluate tofalse.- Type Parameters:
T- Type of the free variable, i.e. the element the predicate is called on.- Parameters:
p1- Passed in predicates.p2- Passed in predicates.- Returns:
- Predicate that evaluates to
trueif each of its component predicates evaluates totrue.
-
and
public static <T> IgnitePredicate<T> and(@Nullable @Nullable IgnitePredicate<? super T> p, @Nullable @Nullable IgnitePredicate<? super T>... ps)
Get a predicate (not peer-deployable) that evaluates totrueif each of its component predicates evaluates totrue. The components are evaluated in order they are supplied. Evaluation will be stopped as soon as first predicate evaluates tofalse. Passed in predicates are NOT copied. If no predicates are passed in the returned predicate will always evaluate tofalse.- Type Parameters:
T- Type of the free variable, i.e. the element the predicate is called on.- Parameters:
ps- Passed in predicate. If none provided - always-falsepredicate is returned.- Returns:
- Predicate that evaluates to
trueif each of its component predicates evaluates totrue.
-
in
public static <T> IgnitePredicate<T> in(@Nullable @Nullable Collection<? extends T> c)
Gets predicate (not peer-deployable) that returnstrueif its free variable is contained in given collection.- Type Parameters:
T- Type of the free variable for the predicate and type of the collection elements.- Parameters:
c- Collection to check for containment.- Returns:
- Predicate (not peer-deployable) that returns
trueif its free variable is contained in given collection.
-
contains
public static <T> IgnitePredicate<T> contains(@Nullable @Nullable Collection<T> c)
Provides predicate (not peer-deployable) which returnstrueif it receives an element that is contained in the passed in collection.- Type Parameters:
T- Element type.- Parameters:
c- Collection used for predicate filter.- Returns:
- Predicate which returns
trueif it receives an element that is contained in the passed in collection.
-
notContains
public static <T> IgnitePredicate<T> notContains(@Nullable @Nullable Collection<T> c)
Provides predicate (not peer-deployable) which returnstrueif it receives an element that is not contained in the passed in collection.- Type Parameters:
T- Element type.- Parameters:
c- Collection used for predicate filter.- Returns:
- Predicate which returns
trueif it receives an element that is not contained in the passed in collection.
-
isAllNodePredicates
public static boolean isAllNodePredicates(@Nullable @Nullable IgnitePredicate<?>... ps)Tests if all passed in predicates are instances ofGridNodePredicateclass.- Parameters:
ps- Collection of predicates to test.- Returns:
Trueif all passed in predicates are instances ofGridNodePredicateclass.
-
asMap
public static <K,V> Map<K,V> asMap(K key, V val)
Creates map with given values, adding a strict not-null check for value.- Type Parameters:
K- Key's type.V- Value's type.- Parameters:
key- Key.val- Value.- Returns:
- Created map.
-
-