Interface VertexTraversal

All Superinterfaces:
VertexConditionTraversal

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

    • filter

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

      EdgeTraversal outE(String... edgeLabels)
      Map the EdgeTraversal to its outgoing incident edges given the edge labels.
      Parameters:
      edgeLabels - the edge labels to traverse
      Returns:
      a EdgeTraversal with the new condition
      Throws:
      NullPointerException - when has any null element
    • inE

      EdgeTraversal inE(String... edgeLabels)
      Map the EdgeTraversal to its incoming incident edges given the edge labels.
      Parameters:
      edgeLabels - the edge labels to traverse
      Returns:
      a EdgeTraversal with the new condition
      Throws:
      NullPointerException - when has any null element
    • bothE

      EdgeTraversal bothE(String... edgeLabels)
      Map the EdgeTraversal to its either incoming or outgoing incident edges given the edge labels.
      Parameters:
      edgeLabels - the edge labels to traverse
      Returns:
      a EdgeTraversal with the new condition
      Throws:
      NullPointerException - when has any null element
    • dedup

      VertexTraversal 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.
    • repeat

      Starts the loop traversal graph
      Returns:
      a VertexRepeatTraversal
    • outE

      default EdgeTraversal outE(Supplier<String> label)
      Map the EdgeTraversal to its outgoing incident edges given the edge labels.
      Parameters:
      label - the edge labels to traverse
      Returns:
      a EdgeTraversal with the new condition
      Throws:
      NullPointerException - when has any null element
    • inE

      default EdgeTraversal inE(Supplier<String> label)
      Map the EdgeTraversal to its incoming incident edges given the edge labels.
      Parameters:
      label - the edge labels to traverse
      Returns:
      a EdgeTraversal with the new condition
      Throws:
      NullPointerException - when has any null element
    • bothE

      default EdgeTraversal bothE(Supplier<String> label)
      Map the EdgeTraversal to its either incoming or outgoing incident edges given the edge labels.
      Parameters:
      label - the edge labels to traverse
      Returns:
      a EdgeTraversal with the new condition
      Throws:
      NullPointerException - when has any null element
    • limit

      VertexTraversal 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 VertexTraversal with the limit
    • skip

      VertexTraversal skip(long skip)
      Filters out the first n objects in the traversal.
      Parameters:
      skip - the number of objects to skip
      Returns:
      a VertexTraversal with skip
    • range

      VertexTraversal range(long start, long end)
      Returns a VertexTraversal with range defined
      Parameters:
      start - the start inclusive
      end - the end exclusive
      Returns:
      a with the range set
    • next

      <T> Optional<T> next()
      Returns the next elements in the traversal. If the traversal is empty, then an Optional.empty() is returned.
      Type Parameters:
      T - the entity type
      Returns:
      the entity result otherwise Optional.empty()
    • result

      <T> Stream<T> result()
      Get all the result in the traversal as Stream
      Type Parameters:
      T - the entity type
      Returns:
      the entity result as Stream
    • singleResult

      <T> Optional<T> singleResult()
      Concludes the traversal that returns a single result
      Type Parameters:
      T - the type
      Returns:
      the entity result otherwise Optional.empty()
    • next

      <T> Stream<T> next(int limit)
      Get the next n-number of results from the traversal.
      Type Parameters:
      T - the entity type
      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
    • count

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

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