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

## Class TraversalExplanation

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

- All Implemented Interfaces:
    Serializable
  Direct Known Subclasses:
    ImmutableExplanation

      public class TraversalExplanation
      extends AbstractExplanation
      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 `AbstractExplanation.toString()` has a pretty-print representation that is useful in the Gremlin Console.
  Author:
    Marko A. Rodriguez (http://markorodriguez.com)
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected List<<any>>` | `strategyTraversals`
    `protected Traversal.Admin<?,?>` | `traversal`

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ImmutableExplanation` | `asImmutable()`
    `protected Stream<<any>>` | `getIntermediates()` First string is the traversal strategy, the second is the category and the third is the traversal representation at that point.
    `Traversal.Admin<?,?>` | `getOriginalTraversal()` Get the original `Traversal` used to create this explanation.
    `protected String` | `getOriginalTraversalAsString()`
    `List<<any>>` | `getStrategyTraversals()` Get the list of `TraversalStrategy` applications.
    `protected Stream<String>` | `getStrategyTraversalsAsString()`

    - ### Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.util.AbstractExplanation

      `getTraversalStepsAsString, prettyPrint, prettyPrint, spacing, toString`

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

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

- - ### Field Detail

    - #### traversal

          protected Traversal.Admin<?,?> traversal

    - #### strategyTraversals

          protected List<<any>> strategyTraversals

  - ### Constructor Detail

    - #### TraversalExplanation

          protected TraversalExplanation()

    - #### 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

    - #### asImmutable

          public ImmutableExplanation asImmutable()

    - #### getStrategyTraversalsAsString

          protected Stream<String> getStrategyTraversalsAsString()

      Specified by:
        `getStrategyTraversalsAsString` in class `AbstractExplanation`

    - #### getOriginalTraversalAsString

          protected String getOriginalTraversalAsString()

      Specified by:
        `getOriginalTraversalAsString` in class `AbstractExplanation`

    - #### getIntermediates

          protected Stream<<any>> getIntermediates()

      Description copied from class: `AbstractExplanation`
      First string is the traversal strategy, the second is the category and the third is the traversal representation at that point.
      Specified by:
        `getIntermediates` in class `AbstractExplanation`

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