org.apache.tinkerpop.gremlin.process.traversal.util

## Class TraversalExplanation

- java.lang.Object
- - org.apache.tinkerpop.gremlin.process.traversal.util.TraversalExplanation

- All Implemented Interfaces:
    Serializable

      public class TraversalExplanation
      extends Object
      implements Serializable

  A TraversalExplanation takes a `Traversal` and, for each registered `TraversalStrategy`, it creates a mapping reflecting how each strategy alters the traversal. This is useful for understanding how each traversal strategy mutates the traversal. This is useful in debugging and analysis of traversal compilation. The `toString()` has a pretty-print representation that is useful in the Gremlin Console.
  Author:
    Marko A. Rodriguez (http://markorodriguez.com)
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TraversalExplanation(Traversal.Admin<?,?> traversal)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Traversal.Admin<?,?>` | `getOriginalTraversal()` Get the original `Traversal` used to create this explanation.
    `List<<any>>` | `getStrategyTraversals()` Get the list of `TraversalStrategy` applications.
    `String` | `prettyPrint()`
    `String` | `prettyPrint(int maxLineLength)` A pretty-print representation of the traversal explanation.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### TraversalExplanation

          public TraversalExplanation(Traversal.Admin<?,?> traversal)

  - ### Method Detail

    - #### getStrategyTraversals

          public List<<any>> getStrategyTraversals()

      Get the list of `TraversalStrategy` applications. For strategy, the resultant mutated `Traversal` is provided.
      Returns:
        the list of strategy/traversal pairs

    - #### getOriginalTraversal

          public Traversal.Admin<?,?> getOriginalTraversal()

      Get the original `Traversal` used to create this explanation.
      Returns:
        the original traversal

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### prettyPrint

          public String prettyPrint()

    - #### prettyPrint

          public String prettyPrint(int maxLineLength)

      A pretty-print representation of the traversal explanation.
      Returns:
        a `String` representation of the traversal explanation

Copyright © 2013–2019 Apache Software Foundation. All rights reserved.