ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [4/5] ignite git commit: IGNITE-2263: Removed "isAll(Predicate)" method.
Date Wed, 30 Dec 2015 14:32:40 GMT
IGNITE-2263: Removed "isAll(Predicate)" method.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9214e3c5
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9214e3c5
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9214e3c5

Branch: refs/heads/ignite-2263
Commit: 9214e3c5f711e625ab41bcbd3298a1493565354c
Parents: 4b7de54
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Wed Dec 30 17:30:18 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Wed Dec 30 17:30:18 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/lang/GridFunc.java     | 26 ++++++--------------
 1 file changed, 7 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9214e3c5/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
index b15bebe..f30abcc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
@@ -1349,7 +1349,7 @@ public class GridFunc {
         return isAlwaysTrue(p) ? c : new GridSerializableCollection<T>() {
             // Pass through (will fail for readonly).
             @Override public boolean add(T e) {
-                return isAll(e, p) && c.add(e);
+                return p.apply(e) && c.add(e);
             }
 
             @NotNull
@@ -1462,7 +1462,7 @@ public class GridFunc {
             /** Entry predicate. */
             private IgnitePredicate<Entry<K, V>> ep = new P1<Map.Entry<K,
V>>() {
                 @Override public boolean apply(Entry<K, V> e) {
-                    return isAll(e.getKey(), p);
+                    return p.apply(e.getKey());
                 }
             };
 
@@ -1480,12 +1480,12 @@ public class GridFunc {
 
                     @SuppressWarnings({"unchecked"})
                     @Override public boolean remove(Object o) {
-                        return F.isAll((Map.Entry<K, V>)o, ep) && m.entrySet().remove(o);
+                        return ep.apply((Map.Entry<K, V>)o) && m.entrySet().remove(o);
                     }
 
                     @SuppressWarnings({"unchecked"})
                     @Override public boolean contains(Object o) {
-                        return F.isAll((Map.Entry<K, V>)o, ep) && m.entrySet().contains(o);
+                        return ep.apply((Map.Entry<K, V>)o) && m.entrySet().contains(o);
                     }
 
                     @Override public boolean isEmpty() {
@@ -1500,13 +1500,13 @@ public class GridFunc {
 
             @SuppressWarnings({"unchecked"})
             @Nullable @Override public V get(Object key) {
-                return isAll((K)key, p) ? m.get(key) : null;
+                return p.apply((K)key) ? m.get(key) : null;
             }
 
             @Nullable @Override public V put(K key, V val) {
                 V oldVal = get(key);
 
-                if (isAll(key, p))
+                if (p.apply(key))
                     m.put(key, val);
 
                 return oldVal;
@@ -1514,7 +1514,7 @@ public class GridFunc {
 
             @SuppressWarnings({"unchecked"})
             @Override public boolean containsKey(Object key) {
-                return isAll((K)key, p) && m.containsKey(key);
+                return p.apply((K)key) && m.containsKey(key);
             }
         };
     }
@@ -2618,18 +2618,6 @@ public class GridFunc {
     }
 
     /**
-     * Shortcut for {@link #isAll(Object, org.apache.ignite.lang.IgnitePredicate[])} method
with only single predicate.
-     *
-     * @param t Value to test.
-     * @param p Predicate.
-     * @return {@code True} if test is passed.
-     */
-    // TODO: To be removed!
-    public static <T> boolean isAll(@Nullable T t, @Nullable IgnitePredicate<? super
T> p) {
-        return p == null || p.apply(t);
-    }
-
-    /**
      * Tests if all provided predicates evaluate to {@code true} for given value. Note that
      * evaluation will be short-circuit when first predicate evaluated to {@code false} is
found.
      *


Mime
View raw message