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

## Class DefaultTraversalStrategies

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

- All Implemented Interfaces:
    Serializable, Cloneable, TraversalStrategies

      public class DefaultTraversalStrategies
      extends Object
      implements TraversalStrategies

  Author:
    Marko A. Rodriguez (http://markorodriguez.com)
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies

      `TraversalStrategies.GlobalCache`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Set<TraversalStrategy<?>>` | `traversalStrategies`

    - ### Fields inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies

      `STRATEGY_CATEGORIES`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultTraversalStrategies()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `TraversalStrategies` | `addStrategies(TraversalStrategy<?>... strategies)` Add all the provided `TraversalStrategy` instances to the current collection.
    `void` | `applyStrategies(Traversal.Admin<?,?> traversal)` Deprecated. As of release 3.3.10, not directly replaced as this mode of strategy application has not been utilized since early days of 3.x
    `DefaultTraversalStrategies` | `clone()`
    `<T extends TraversalStrategy> Optional<T>` | `getStrategy(Class<T> traversalStrategyClass)` Return the `TraversalStrategy` instance associated with the provided class.
    `TraversalStrategies` | `removeStrategies(Class<? extends TraversalStrategy>... strategyClasses)` Remove all the provided `TraversalStrategy` classes from the current collection.
    `List<TraversalStrategy<?>>` | `toList()` Return all the `TraversalStrategy` singleton instances associated with this `TraversalStrategies`.
    `String` | `toString()`

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

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

    - ### Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies

      `sortStrategies, visit`

- - ### Field Detail

    - #### traversalStrategies

          protected Set<TraversalStrategy<?>> traversalStrategies

  - ### Constructor Detail

    - #### DefaultTraversalStrategies

          public DefaultTraversalStrategies()

  - ### Method Detail

    - #### addStrategies

          public TraversalStrategies addStrategies(TraversalStrategy<?>... strategies)

      Description copied from interface: `TraversalStrategies`
      Add all the provided `TraversalStrategy` instances to the current collection. When all the provided strategies have been added, the collection is resorted.
      Specified by:
        `addStrategies` in interface `TraversalStrategies`
      Parameters:
        `strategies` - the traversal strategies to add
      Returns:
        the newly updated/sorted traversal strategies collection

    - #### removeStrategies

          public TraversalStrategies removeStrategies(Class<? extends TraversalStrategy>... strategyClasses)

      Description copied from interface: `TraversalStrategies`
      Remove all the provided `TraversalStrategy` classes from the current collection. When all the provided strategies have been removed, the collection is resorted.
      Specified by:
        `removeStrategies` in interface `TraversalStrategies`
      Parameters:
        `strategyClasses` - the traversal strategies to remove by their class
      Returns:
        the newly updated/sorted traversal strategies collection

    - #### toList

          public List<TraversalStrategy<?>> toList()

      Description copied from interface: `TraversalStrategies`
      Return all the `TraversalStrategy` singleton instances associated with this `TraversalStrategies`.
      Specified by:
        `toList` in interface `TraversalStrategies`

    - #### getStrategy

          public <T extends TraversalStrategy> Optional<T> getStrategy(Class<T> traversalStrategyClass)

      Description copied from interface: `TraversalStrategies`
      Return the `TraversalStrategy` instance associated with the provided class.
      Specified by:
        `getStrategy` in interface `TraversalStrategies`
      Type Parameters:
        `T` - the strategy class type
      Parameters:
        `traversalStrategyClass` - the class of the strategy to get
      Returns:
        an optional containing the strategy instance or not

    - #### applyStrategies

          @Deprecated
          public void applyStrategies(Traversal.Admin<?,?> traversal)

      Deprecated. As of release 3.3.10, not directly replaced as this mode of strategy application has not been utilized since early days of 3.x
      Description copied from interface: `TraversalStrategies`
      Apply all the `TraversalStrategy` optimizers to the `Traversal` for the stated `TraversalEngine`. This method must ensure that the strategies are sorted prior to application.
      Specified by:
        `applyStrategies` in interface `TraversalStrategies`
      Parameters:
        `traversal` - the traversal to apply the strategies to

    - #### clone

          public DefaultTraversalStrategies clone()

      Specified by:
        `clone` in interface `TraversalStrategies`
      Overrides:
        `clone` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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