Guest User

Untitled

a guest
Jul 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. public default GraphTraversal<S, ?> incrementProperty(final String propertyKey,
  2. final GraphTraversal<?,?> valueTraversal) {
  3. return property(Cardinality.single, propertyKey,
  4. __.union(
  5. __.values(propertyKey),
  6. valueTraversal)
  7. .sum());
  8. }
  9.  
  10. public default GraphTraversal<S, ?> decrementProperty(final String propertyKey,
  11. final GraphTraversal<?,?> valueTraversal) {
  12. return property(Cardinality.single, propertyKey,
  13. __.union(
  14. __.values(propertyKey),
  15. valueTraversal).math("_ * -1")
  16. .sum());
  17. }
Add Comment
Please, Sign In to add comment