Class ArrayTraversalStep<DataType>

java.lang.Object
com.bazaarvoice.jolt.traversr.traversal.BaseTraversalStep<List<Object>,DataType>
com.bazaarvoice.jolt.traversr.traversal.ArrayTraversalStep<DataType>
All Implemented Interfaces:
TraversalStep<List<Object>,DataType>
Direct Known Subclasses:
AutoExpandArrayTraversalStep

public class ArrayTraversalStep<DataType> extends BaseTraversalStep<List<Object>,DataType>
TraversalStep that expects to handle List objects.
  • Constructor Details

  • Method Details

    • getStepType

      public Class getStepType()
      Description copied from interface: TraversalStep
      Return the Class of the Generic T, so that it can be used in an "instanceof" style check.
      Returns:
      Class that matches Generic parameter T
    • newContainer

      public List<Object> newContainer()
      Description copied from interface: TraversalStep
      Create a new mutable Map or List, suitable for this PathElement to traverse.
      Returns:
      new List or Map, depending on the type of the Traversal
    • get

      public Optional<DataType> get(List<Object> list, String key)
      Description copied from interface: TraversalStep
      Return the data for the key from the provided tree object.
      Returns:
      data object if available, or null.
    • remove

      public Optional<DataType> remove(List<Object> list, String key)
      Description copied from interface: TraversalStep
      Remove and return the data for the key from the provided tree object.
      Returns:
      data object if available, or null.
    • overwriteSet

      public Optional<DataType> overwriteSet(List<Object> list, String key, DataType data)
      Description copied from interface: TraversalStep
      Insert the data into the tree, overwriting any data that is there.
      Returns:
      returns the data object if successful or null if it could not
    • ensureArraySize

      private static void ensureArraySize(List<Object> list, Integer upperIndex)