atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sar...@apache.org
Subject atlas git commit: ATLAS-2184: IS_NULL and NOT_NULL operator support
Date Fri, 29 Sep 2017 23:57:46 GMT
Repository: atlas
Updated Branches:
  refs/heads/master f18555cdd -> 57fbb9cea


ATLAS-2184: IS_NULL and NOT_NULL operator support

Signed-off-by: Sarath Subramanian <ssubramanian@hortonworks.com>


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/57fbb9ce
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/57fbb9ce
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/57fbb9ce

Branch: refs/heads/master
Commit: 57fbb9cea1592a85b59a02b6a672bab43092f1d3
Parents: f18555c
Author: apoorvnaik <apoorvnaik@apache.org>
Authored: Fri Sep 29 16:53:38 2017 -0700
Committer: Sarath Subramanian <ssubramanian@hortonworks.com>
Committed: Fri Sep 29 16:53:38 2017 -0700

----------------------------------------------------------------------
 .../atlas/model/discovery/SearchParameters.java |   6 +-
 .../apache/atlas/discovery/SearchProcessor.java |  21 +-
 .../apache/atlas/util/SearchPredicateUtil.java  | 330 +++++++++++--------
 3 files changed, 222 insertions(+), 135 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/57fbb9ce/intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java
----------------------------------------------------------------------
diff --git a/intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java b/intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java
index a7a71b7..f5a4813 100644
--- a/intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java
+++ b/intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java
@@ -346,10 +346,12 @@ public class SearchParameters implements Serializable {
         IN(new String[]{"in", "IN"}),
         LIKE(new String[]{"like", "LIKE"}),
         STARTS_WITH(new String[]{"startsWith", "STARTSWITH", "begins_with", "BEGINS_WITH"}),
-        ENDS_WITH(new String[]{"endsWith", "ENDSWITH", "ends_with", "BEGINS_WITH"}),
+        ENDS_WITH(new String[]{"endsWith", "ENDSWITH", "ends_with", "ENDS_WITH"}),
         CONTAINS(new String[]{"contains", "CONTAINS"}),
         CONTAINS_ANY(new String[]{"containsAny", "CONTAINSANY", "contains_any", "CONTAINS_ANY"}),
-        CONTAINS_ALL(new String[]{"containsAll", "CONTAINSALL", "contains_all", "CONTAINS_ALL"})
+        CONTAINS_ALL(new String[]{"containsAll", "CONTAINSALL", "contains_all", "CONTAINS_ALL"}),
+        IS_NULL(new String[]{"isNull", "ISNULL", "is_null", "IS_NULL"}),
+        NOT_NULL(new String[]{"notNull", "NOTNULL", "not_null", "NOT_NULL"}),
         ;
         static final Map<String, Operator> operatorsMap = new HashMap<>();
 

http://git-wip-us.apache.org/repos/asf/atlas/blob/57fbb9ce/repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java
----------------------------------------------------------------------
diff --git a/repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java b/repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java
index b380e1e..a20a6c1 100644
--- a/repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java
+++ b/repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java
@@ -103,6 +103,14 @@ public abstract class SearchProcessor {
 
         OPERATOR_MAP.put(SearchParameters.Operator.CONTAINS, "v.\"%s\": (*%s*)");
         OPERATOR_PREDICATE_MAP.put(SearchParameters.Operator.CONTAINS, getContainsPredicateGenerator());
+
+        // TODO: Add contains any, contains all mappings here
+
+        OPERATOR_MAP.put(SearchParameters.Operator.IS_NULL, "(*:* NOT v.\"%s\":[* TO *])");
+        OPERATOR_PREDICATE_MAP.put(SearchParameters.Operator.IS_NULL, getIsNullPredicateGenerator());
+
+        OPERATOR_MAP.put(SearchParameters.Operator.NOT_NULL, "v.\"%s\":[* TO *]");
+        OPERATOR_PREDICATE_MAP.put(SearchParameters.Operator.NOT_NULL, getNotNullPredicateGenerator());
     }
 
     protected final SearchContext   context;
@@ -428,9 +436,10 @@ public abstract class SearchProcessor {
 
         try {
             if (OPERATOR_MAP.get(op) != null) {
-                String qualifiedName = type.getQualifiedAttributeName(attrName);
+                String qualifiedName         = type.getQualifiedAttributeName(attrName);
+                String escapeIndexQueryValue = AtlasAttribute.escapeIndexQueryValue(attrVal);
 
-                ret = String.format(OPERATOR_MAP.get(op), qualifiedName, AtlasStructType.AtlasAttribute.escapeIndexQueryValue(attrVal));
+                ret = String.format(OPERATOR_MAP.get(op), qualifiedName, escapeIndexQueryValue);
             }
         } catch (AtlasBaseException ex) {
             LOG.warn(ex.getMessage());
@@ -572,7 +581,13 @@ public abstract class SearchProcessor {
                         case ENDS_WITH:
                             query.has(qualifiedName, AtlasGraphQuery.MatchingOperator.REGEX,
getSuffixRegex(attrValue));
                             break;
-                        case IN:
+                        case IS_NULL:
+                            query.has(qualifiedName, AtlasGraphQuery.ComparisionOperator.EQUAL,
null);
+                            break;
+                        case NOT_NULL:
+                            query.has(qualifiedName, AtlasGraphQuery.ComparisionOperator.NOT_EQUAL,
null);
+                            break;
+                        default:
                             LOG.warn("{}: unsupported operator. Ignored", operator);
                             break;
                     }

http://git-wip-us.apache.org/repos/asf/atlas/blob/57fbb9ce/repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
----------------------------------------------------------------------
diff --git a/repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java b/repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
index 18d77ee..540cdba 100644
--- a/repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
+++ b/repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
@@ -326,8 +326,8 @@ public class SearchPredicateUtil {
                 } else {
                     ret = new VertexAttributePredicate(attrName, attrClass) {
                         @Override
-                        public boolean compareValue(final Object value) {
-                            return CollectionUtils.containsAny((Collection) attrVal, (Collection)
value);
+                        public boolean compareValue(final Object vertexAttrVal) {
+                            return CollectionUtils.containsAny((Collection) attrVal, (Collection)
vertexAttrVal);
                         }
                     };
                 }
@@ -361,8 +361,8 @@ public class SearchPredicateUtil {
                 } else {
                     ret = new VertexAttributePredicate(attrName, attrClass) {
                         @Override
-                        public boolean compareValue(final Object value) {
-                            return ((Collection) attrVal).containsAll((Collection) value);
+                        public boolean compareValue(final Object vertexAttrVal) {
+                            return ((Collection) attrVal).containsAll((Collection) vertexAttrVal);
                         }
                     };
                 }
@@ -396,8 +396,8 @@ public class SearchPredicateUtil {
                 } else {
                     ret = new VertexAttributePredicate(attrName, attrClass) {
                         @Override
-                        public boolean compareValue(final Object value) {
-                            return ((Collection)attrVal).contains(value);
+                        public boolean compareValue(final Object vertexAttrVal) {
+                            return ((Collection)attrVal).contains(vertexAttrVal);
                         }
                     };
                 }
@@ -522,8 +522,8 @@ public class SearchPredicateUtil {
                     // Check if the provided value is present in the list of stored values
                     ret = new VertexAttributePredicate(attrName, attrClass) {
                         @Override
-                        protected boolean compareValue(final Object value) {
-                            return ((Collection) value).contains(attrVal);
+                        protected boolean compareValue(final Object vertexAttrVal) {
+                            return ((Collection) vertexAttrVal).contains(attrVal);
                         }
                     };
                 } else {
@@ -541,17 +541,87 @@ public class SearchPredicateUtil {
         return ret;
     }
 
+    public static VertexAttributePredicateGenerator getIsNullPredicateGenerator() {
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("==> getIsNullPredicateGenerator");
+        }
+
+        VertexAttributePredicateGenerator ret = new VertexAttributePredicateGenerator() {
+            @Override
+            public Predicate generatePredicate(final String attrName, final Object attrVal,
final Class attrClass) {
+                final Predicate ret;
+
+                if (attrName == null || attrClass == null) {
+                    ret = ALWAYS_FALSE;
+                } else {
+                    ret = new VertexAttributePredicate(attrName, attrClass, true) {
+                        @Override
+                        protected boolean compareValue(final Object vertexAttrVal) {
+                            return vertexAttrVal == null;
+                        }
+                    };
+                }
+
+                return ret;
+            }
+        };
+
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("<== getIsNullPredicateGenerator");
+        }
+
+        return ret;
+    }
+
+    public static VertexAttributePredicateGenerator getNotNullPredicateGenerator() {
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("==> getNotNullPredicateGenerator");
+        }
+
+        VertexAttributePredicateGenerator ret = new VertexAttributePredicateGenerator() {
+            @Override
+            public Predicate generatePredicate(final String attrName, final Object attrVal,
final Class attrClass) {
+                final Predicate ret;
+
+                if (attrName == null || attrClass == null) {
+                    ret = ALWAYS_FALSE;
+                } else {
+                    ret = new VertexAttributePredicate(attrName, attrClass, true) {
+                        @Override
+                        protected boolean compareValue(final Object vertexAttrVal) {
+                            return vertexAttrVal != null;
+                        }
+                    };
+                }
+
+                return ret;
+            }
+        };
+
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("<== getNotNullPredicateGenerator");
+        }
+
+        return ret;
+    }
+
     public interface VertexAttributePredicateGenerator {
         Predicate generatePredicate(String attrName, Object attrVal, Class attrClass);
     }
 
     static abstract class VertexAttributePredicate implements Predicate {
-        final String attrName;
-        final Class  attrClass;
+        final String  attrName;
+        final Class   attrClass;
+        final boolean isNullValid;
 
         VertexAttributePredicate(String attrName, Class attrClass) {
+            this(attrName, attrClass, false);
+        }
+
+        VertexAttributePredicate(String attrName, Class attrClass, boolean isNullValid) {
             this.attrName  = attrName;
             this.attrClass = attrClass;
+            this.isNullValid = isNullValid;
         }
 
         @Override
@@ -568,7 +638,7 @@ public class SearchPredicateUtil {
                     attrValue = AtlasGraphUtilsV1.getProperty(vertex, attrName, attrClass);
                 }
 
-                ret = attrValue != null && compareValue(attrValue);
+                ret = (isNullValid || attrValue != null) && compareValue(attrValue);
             } else {
                 ret = false;
             }
@@ -576,7 +646,7 @@ public class SearchPredicateUtil {
             return ret;
         }
 
-        protected abstract boolean compareValue(Object value);
+        protected abstract boolean compareValue(Object vertexAttrVal);
     }
 
     static abstract class BooleanPredicate extends VertexAttributePredicate {
@@ -590,16 +660,16 @@ public class SearchPredicateUtil {
 
         static VertexAttributePredicate getEQPredicate(String attrName, Class attrClass,
Boolean value) {
             return new SearchPredicateUtil.BooleanPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Boolean) value).compareTo(this.value) == 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Boolean) vertexAttrVal).compareTo(value) == 0;
                 }
             };
         }
 
         static VertexAttributePredicate getNEQPredicate(String attrName, Class attrClass,
Boolean value) {
             return new SearchPredicateUtil.BooleanPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Boolean) value).compareTo(this.value) != 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Boolean) vertexAttrVal).compareTo(value) != 0;
                 }
             };
         }
@@ -616,48 +686,48 @@ public class SearchPredicateUtil {
 
         static VertexAttributePredicate getEQPredicate(String attrName, Class attrClass,
Short value) {
             return new ShortPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Short)value).compareTo(this.value) == 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Short) vertexAttrVal).compareTo(value) == 0;
                 }
             };
         }
 
         static VertexAttributePredicate getNEQPredicate(String attrName, Class attrClass,
Short value) {
             return new ShortPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Short)value).compareTo(this.value) != 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Short) vertexAttrVal).compareTo(value) != 0;
                 }
             };
         }
 
         static VertexAttributePredicate getLTPredicate(String attrName, Class attrClass,
Short value) {
             return new ShortPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Short)value).compareTo(this.value) < 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Short) vertexAttrVal).compareTo(value) < 0;
                 }
             };
         }
 
         static VertexAttributePredicate getLTEPredicate(String attrName, Class attrClass,
Short value) {
             return new ShortPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Short)value).compareTo(this.value) <= 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Short) vertexAttrVal).compareTo(value) <= 0;
                 }
             };
         }
 
         static VertexAttributePredicate getGTPredicate(String attrName, Class attrClass,
Short value) {
             return new ShortPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Short)value).compareTo(this.value) > 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Short) vertexAttrVal).compareTo(value) > 0;
                 }
             };
         }
 
         static VertexAttributePredicate getGTEPredicate(String attrName, Class attrClass,
Short value) {
             return new ShortPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Short)value).compareTo(this.value) >= 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Short) vertexAttrVal).compareTo(value) >= 0;
                 }
             };
         }
@@ -674,48 +744,48 @@ public class SearchPredicateUtil {
 
         static VertexAttributePredicate getEQPredicate(String attrName, Class attrClass,
Integer value) {
             return new IntegerPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Integer)value).compareTo(this.value) == 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Integer) vertexAttrVal).compareTo(value) == 0;
                 }
             };
         }
 
         static VertexAttributePredicate getNEQPredicate(String attrName, Class attrClass,
Integer value) {
             return new IntegerPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Integer)value).compareTo(this.value) != 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Integer) vertexAttrVal).compareTo(value) != 0;
                 }
             };
         }
 
         static VertexAttributePredicate getLTPredicate(String attrName, Class attrClass,
Integer value) {
             return new IntegerPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Integer)value).compareTo(this.value) < 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Integer) vertexAttrVal).compareTo(value) < 0;
                 }
             };
         }
 
         static VertexAttributePredicate getLTEPredicate(String attrName, Class attrClass,
Integer value) {
             return new IntegerPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Integer)value).compareTo(this.value) <= 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Integer) vertexAttrVal).compareTo(value) <= 0;
                 }
             };
         }
 
         static VertexAttributePredicate getGTPredicate(String attrName, Class attrClass,
Integer value) {
             return new IntegerPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Integer)value).compareTo(this.value) > 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Integer) vertexAttrVal).compareTo(value) > 0;
                 }
             };
         }
 
         static VertexAttributePredicate getGTEPredicate(String attrName, Class attrClass,
Integer value) {
             return new IntegerPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Integer)value).compareTo(this.value) >= 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Integer) vertexAttrVal).compareTo(value) >= 0;
                 }
             };
         }
@@ -732,48 +802,48 @@ public class SearchPredicateUtil {
 
         static VertexAttributePredicate getEQPredicate(String attrName, Class attrClass,
Long value) {
             return new LongPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Long)value).compareTo(this.value) == 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Long) vertexAttrVal).compareTo(value) == 0;
                 }
             };
         }
 
         static VertexAttributePredicate getNEQPredicate(String attrName, Class attrClass,
Long value) {
             return new LongPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Long)value).compareTo(this.value) != 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Long) vertexAttrVal).compareTo(value) != 0;
                 }
             };
         }
 
         static VertexAttributePredicate getLTPredicate(String attrName, Class attrClass,
Long value) {
             return new LongPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Long)value).compareTo(this.value) < 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Long) vertexAttrVal).compareTo(value) < 0;
                 }
             };
         }
 
         static VertexAttributePredicate getLTEPredicate(String attrName, Class attrClass,
Long value) {
             return new LongPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Long)value).compareTo(this.value) <= 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Long) vertexAttrVal).compareTo(value) <= 0;
                 }
             };
         }
 
         static VertexAttributePredicate getGTPredicate(String attrName, Class attrClass,
Long value) {
             return new LongPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Long)value).compareTo(this.value) > 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Long) vertexAttrVal).compareTo(value) > 0;
                 }
             };
         }
 
         static VertexAttributePredicate getGTEPredicate(String attrName, Class attrClass,
Long value) {
             return new LongPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Long)value).compareTo(this.value) >= 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Long) vertexAttrVal).compareTo(value) >= 0;
                 }
             };
         }
@@ -790,48 +860,48 @@ public class SearchPredicateUtil {
 
         static VertexAttributePredicate getEQPredicate(String attrName, Class attrClass,
Float value) {
             return new FloatPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Float)value).compareTo(this.value) == 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Float) vertexAttrVal).compareTo(value) == 0;
                 }
             };
         }
 
         static VertexAttributePredicate getNEQPredicate(String attrName, Class attrClass,
Float value) {
             return new FloatPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Float)value).compareTo(this.value) != 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Float) vertexAttrVal).compareTo(value) != 0;
                 }
             };
         }
 
         static VertexAttributePredicate getLTPredicate(String attrName, Class attrClass,
Float value) {
             return new FloatPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Float)value).compareTo(this.value) < 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Float) vertexAttrVal).compareTo(value) < 0;
                 }
             };
         }
 
         static VertexAttributePredicate getLTEPredicate(String attrName, Class attrClass,
Float value) {
             return new FloatPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Float)value).compareTo(this.value) <= 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Float) vertexAttrVal).compareTo(value) <= 0;
                 }
             };
         }
 
         static VertexAttributePredicate getGTPredicate(String attrName, Class attrClass,
Float value) {
             return new FloatPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Float)value).compareTo(this.value) > 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Float) vertexAttrVal).compareTo(value) > 0;
                 }
             };
         }
 
         static VertexAttributePredicate getGTEPredicate(String attrName, Class attrClass,
Float value) {
             return new FloatPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Float)value).compareTo(this.value) >= 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Float) vertexAttrVal).compareTo(value) >= 0;
                 }
             };
         }
@@ -848,48 +918,48 @@ public class SearchPredicateUtil {
 
         static VertexAttributePredicate getEQPredicate(String attrName, Class attrClass,
Double value) {
             return new DoublePredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Double)value).compareTo(this.value) == 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Double) vertexAttrVal).compareTo(value) == 0;
                 }
             };
         }
 
         static VertexAttributePredicate getNEQPredicate(String attrName, Class attrClass,
Double value) {
             return new DoublePredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Double)value).compareTo(this.value) != 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Double) vertexAttrVal).compareTo(value) != 0;
                 }
             };
         }
 
         static VertexAttributePredicate getLTPredicate(String attrName, Class attrClass,
Double value) {
             return new DoublePredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Double)value).compareTo(this.value) < 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Double) vertexAttrVal).compareTo(value) < 0;
                 }
             };
         }
 
         static VertexAttributePredicate getLTEPredicate(String attrName, Class attrClass,
Double value) {
             return new DoublePredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Double)value).compareTo(this.value) <= 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Double) vertexAttrVal).compareTo(value) <= 0;
                 }
             };
         }
 
         static VertexAttributePredicate getGTPredicate(String attrName, Class attrClass,
Double value) {
             return new DoublePredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Double)value).compareTo(this.value) > 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Double) vertexAttrVal).compareTo(value) > 0;
                 }
             };
         }
 
         static VertexAttributePredicate getGTEPredicate(String attrName, Class attrClass,
Double value) {
             return new DoublePredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Double)value).compareTo(this.value) >= 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Double) vertexAttrVal).compareTo(value) >= 0;
                 }
             };
         }
@@ -906,48 +976,48 @@ public class SearchPredicateUtil {
 
         static VertexAttributePredicate getEQPredicate(String attrName, Class attrClass,
Byte value) {
             return new BytePredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Byte)value).compareTo(this.value) == 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Byte) vertexAttrVal).compareTo(value) == 0;
                 }
             };
         }
 
         static VertexAttributePredicate getNEQPredicate(String attrName, Class attrClass,
Byte value) {
             return new BytePredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Byte)value).compareTo(this.value) != 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Byte) vertexAttrVal).compareTo(value) != 0;
                 }
             };
         }
 
         static VertexAttributePredicate getLTPredicate(String attrName, Class attrClass,
Byte value) {
             return new BytePredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Byte)value).compareTo(this.value) < 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Byte) vertexAttrVal).compareTo(value) < 0;
                 }
             };
         }
 
         static VertexAttributePredicate getLTEPredicate(String attrName, Class attrClass,
Byte value) {
             return new BytePredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Byte)value).compareTo(this.value) <= 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Byte) vertexAttrVal).compareTo(value) <= 0;
                 }
             };
         }
 
         static VertexAttributePredicate getGTPredicate(String attrName, Class attrClass,
Byte value) {
             return new BytePredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Byte)value).compareTo(this.value) > 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Byte) vertexAttrVal).compareTo(value) > 0;
                 }
             };
         }
 
         static VertexAttributePredicate getGTEPredicate(String attrName, Class attrClass,
Byte value) {
             return new BytePredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((Byte)value).compareTo(this.value) >= 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((Byte) vertexAttrVal).compareTo(value) >= 0;
                 }
             };
         }
@@ -964,48 +1034,48 @@ public class SearchPredicateUtil {
 
         static VertexAttributePredicate getEQPredicate(String attrName, Class attrClass,
BigInteger value) {
             return new BigIntegerPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((BigInteger)value).compareTo(this.value) == 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((BigInteger) vertexAttrVal).compareTo(value) == 0;
                 }
             };
         }
 
         static VertexAttributePredicate getNEQPredicate(String attrName, Class attrClass,
BigInteger value) {
             return new BigIntegerPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((BigInteger)value).compareTo(this.value) != 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((BigInteger) vertexAttrVal).compareTo(value) != 0;
                 }
             };
         }
 
         static VertexAttributePredicate getLTPredicate(String attrName, Class attrClass,
BigInteger value) {
             return new BigIntegerPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((BigInteger)value).compareTo(this.value) < 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((BigInteger) vertexAttrVal).compareTo(value) < 0;
                 }
             };
         }
 
         static VertexAttributePredicate getLTEPredicate(String attrName, Class attrClass,
BigInteger value) {
             return new BigIntegerPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((BigInteger)value).compareTo(this.value) <= 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((BigInteger) vertexAttrVal).compareTo(value) <= 0;
                 }
             };
         }
 
         static VertexAttributePredicate getGTPredicate(String attrName, Class attrClass,
BigInteger value) {
             return new BigIntegerPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((BigInteger)value).compareTo(this.value) > 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((BigInteger) vertexAttrVal).compareTo(value) > 0;
                 }
             };
         }
 
         static VertexAttributePredicate getGTEPredicate(String attrName, Class attrClass,
BigInteger value) {
             return new BigIntegerPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((BigInteger)value).compareTo(this.value) >= 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((BigInteger) vertexAttrVal).compareTo(value) >= 0;
                 }
             };
         }
@@ -1022,48 +1092,48 @@ public class SearchPredicateUtil {
 
         static VertexAttributePredicate getEQPredicate(String attrName, Class attrClass,
BigDecimal value) {
             return new BigDecimalPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((BigDecimal)value).compareTo(this.value) == 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((BigDecimal) vertexAttrVal).compareTo(value) == 0;
                 }
             };
         }
 
         static VertexAttributePredicate getNEQPredicate(String attrName, Class attrClass,
BigDecimal value) {
             return new BigDecimalPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((BigDecimal)value).compareTo(this.value) != 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((BigDecimal) vertexAttrVal).compareTo(value) != 0;
                 }
             };
         }
 
         static VertexAttributePredicate getLTPredicate(String attrName, Class attrClass,
BigDecimal value) {
             return new BigDecimalPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((BigDecimal)value).compareTo(this.value) < 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((BigDecimal) vertexAttrVal).compareTo(value) < 0;
                 }
             };
         }
 
         static VertexAttributePredicate getLTEPredicate(String attrName, Class attrClass,
BigDecimal value) {
             return new BigDecimalPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((BigDecimal)value).compareTo(this.value) <= 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((BigDecimal) vertexAttrVal).compareTo(value) <= 0;
                 }
             };
         }
 
         static VertexAttributePredicate getGTPredicate(String attrName, Class attrClass,
BigDecimal value) {
             return new BigDecimalPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((BigDecimal)value).compareTo(this.value) > 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((BigDecimal) vertexAttrVal).compareTo(value) > 0;
                 }
             };
         }
 
         static VertexAttributePredicate getGTEPredicate(String attrName, Class attrClass,
BigDecimal value) {
             return new BigDecimalPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((BigDecimal)value).compareTo(this.value) >= 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((BigDecimal) vertexAttrVal).compareTo(value) >= 0;
                 }
             };
         }
@@ -1080,72 +1150,72 @@ public class SearchPredicateUtil {
 
         static VertexAttributePredicate getEQPredicate(String attrName, Class attrClass,
String value) {
             return new StringPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((String)value).compareTo(this.value) == 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((String) vertexAttrVal).compareTo(value) == 0;
                 }
             };
         }
 
         static VertexAttributePredicate getNEQPredicate(String attrName, Class attrClass,
String value) {
             return new StringPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((String)value).compareTo(this.value) != 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((String) vertexAttrVal).compareTo(value) != 0;
                 }
             };
         }
 
         static VertexAttributePredicate getLTPredicate(String attrName, Class attrClass,
String value) {
             return new StringPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((String)value).compareTo(this.value) < 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((String) vertexAttrVal).compareTo(value) < 0;
                 }
             };
         }
 
         static VertexAttributePredicate getLTEPredicate(String attrName, Class attrClass,
String value) {
             return new StringPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((String)value).compareTo(this.value) <= 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((String) vertexAttrVal).compareTo(value) <= 0;
                 }
             };
         }
 
         static VertexAttributePredicate getGTPredicate(String attrName, Class attrClass,
String value) {
             return new StringPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((String)value).compareTo(this.value) > 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((String) vertexAttrVal).compareTo(value) > 0;
                 }
             };
         }
 
         static VertexAttributePredicate getGTEPredicate(String attrName, Class attrClass,
String value) {
             return new StringPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((String)value).compareTo(this.value) >= 0;
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((String) vertexAttrVal).compareTo(value) >= 0;
                 }
             };
         }
 
         static VertexAttributePredicate getContainsPredicate(String attrName, Class attrClass,
String value) {
             return new StringPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((String)value).contains(this.value);
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((String) vertexAttrVal).contains(value);
                 }
             };
         }
 
         static VertexAttributePredicate getStartsWithPredicate(String attrName, Class attrClass,
String value) {
             return new StringPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((String)value).startsWith(this.value);
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((String) vertexAttrVal).startsWith(value);
                 }
             };
         }
 
         static VertexAttributePredicate getEndsWithPredicate(String attrName, Class attrClass,
String value) {
             return new StringPredicate(attrName, attrClass, value) {
-                protected boolean compareValue(Object value) {
-                    return ((String)value).endsWith(this.value);
+                protected boolean compareValue(Object vertexAttrVal) {
+                    return ((String) vertexAttrVal).endsWith(value);
                 }
             };
         }


Mime
View raw message