Java Code Examples for org.apache.tinkerpop.gremlin.process.traversal.P#test()
The following examples show how to use
org.apache.tinkerpop.gremlin.process.traversal.P#test() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TraversalUtil.java From hugegraph with Apache License 2.0 | 5 votes |
public static boolean testProperty(Property<?> prop, Object expected) { Object actual = prop.value(); P<Object> predicate; if (expected instanceof String && ((String) expected).startsWith(TraversalUtil.P_CALL)) { predicate = TraversalUtil.parsePredicate(((String) expected)); } else { predicate = ConditionP.eq(expected); } updatePredicateValue(predicate, ((HugeProperty<?>) prop).propertyKey()); return predicate.test(actual); }
Example 2
Source File: AndP.java From tinkerpop with Apache License 2.0 | 5 votes |
@Override public boolean test(final V valueA, final V valueB) { for (final P<V> predicate : this.andP.predicates) { if (!predicate.test(valueA)) return false; } return true; }
Example 3
Source File: OrP.java From tinkerpop with Apache License 2.0 | 5 votes |
@Override public boolean test(final V valueA, final V valueB) { for (final P<V> predicate : this.orP.predicates) { if (predicate.test(valueA)) return true; } return false; }