Interface EdgeTraversal

All Superinterfaces:
EdgeConditionTraversal

public interface EdgeTraversal extends EdgeConditionTraversal
The Graph Traversal that maps Edge. This Traversal is lazy, in other words, that just run after any finalizing method.
  • Method Details

    • filter

      EdgeTraversal filter(Predicate<EdgeEntity> predicate)
      Does a filter predicate based
      Parameters:
      predicate - a predicate to apply to each element to determine if it should be included
      Returns:
      a with the Vertex predicate
      Throws:
      NullPointerException - when predicate is null
    • limit

      EdgeTraversal limit(long limit)
      Filter the objects in the traversal by the number of them to pass through the next, where only the first n objects are allowed as defined by the limit argument.
      Parameters:
      limit - the number at which to end the next
      Returns:
      a with the limit
    • range

      EdgeTraversal range(long start, long end)
      Returns an EdgeTraversal with range defined
      Parameters:
      start - the start inclusive
      end - the end exclusive
      Returns:
      a with the range set
    • repeat

      Starts the loop traversal graph
      Returns:
      a EdgeRepeatTraversal
    • next

      Returns the next elements in the traversal. If the traversal is empty, then an Optional.empty() is returned.
      Returns:
      the EdgeEntity result otherwise Optional.empty()
    • singleResult

      Optional<EdgeEntity> singleResult()
      Concludes the traversal that returns a single EdgeEntity result
      Returns:
      the EdgeEntity result otherwise Optional.empty()
    • result

      Stream<EdgeEntity> result()
      Concludes the traversal then returns the result as list.
      Returns:
      the entities result
    • inV

      Converts to vertex traversal taking the incoming Vertex
      Returns:
      VertexTraversal
    • outV

      Converts to vertex traversal taking the outgoing Vertex
      Returns:
      VertexTraversal
    • bothV

      Converts to vertex traversal taking both incoming and outgoing Vertex
      Returns:
      VertexTraversal
    • dedup

      EdgeTraversal dedup(String... labels)
      Remove all duplicates in the traversal stream up to this point.
      Parameters:
      labels - if labels are provided, then the scoped object's labels determine de-duplication. No labels implies current object.
      Returns:
      the traversal with an appended DedupGlobalStep.
    • stream

      Stream<EdgeEntity> stream()
      Get all the result in the traversal as Stream
      Returns:
      the entity result as Stream
    • next

      Stream<EdgeEntity> next(int limit)
      Get the next n elements result as next, the number of elements is limit based
      Parameters:
      limit - the limit to result
      Returns:
      the entity result as Stream
    • valueMap

      ValueMapTraversal valueMap(String... propertyKeys)
      Map the Element to a Map of the properties key'd according to their Property.key(). If no property keys are provided, then all properties are retrieved.
      Parameters:
      propertyKeys - the properties to retrieve
      Returns:
      a ValueMapTraversal instance
    • orderBy

      EdgeTraversalOrder orderBy(String property)
      Defines the order of the Edge, the property must have in all elements. Otherwise, it'll return an exception. As recommendation use EdgeConditionTraversal.has(String) before this method
      Parameters:
      property - the property to be order
      Returns:
      the EdgeTraversalOrder to define the order way
      Throws:
      NullPointerException - when the property is null
      IllegalStateException - when there any Edge that does not have the property
    • count

      long count()
      Map the traversal next to its reduction as a sum of the elements
      Returns:
      the sum