Package com.bazaarvoice.jolt.shiftr
Class ShiftrTraversr<DataType>
- java.lang.Object
-
- com.bazaarvoice.jolt.traversr.Traversr<DataType>
-
- com.bazaarvoice.jolt.traversr.SimpleTraversr<DataType>
-
- com.bazaarvoice.jolt.shiftr.ShiftrTraversr<DataType>
-
public class ShiftrTraversr<DataType> extends SimpleTraversr<DataType>
Traverser that does not overwrite data.
-
-
Constructor Summary
Constructors Constructor Description ShiftrTraversr(java.lang.String humanPath)
ShiftrTraversr(java.util.List<java.lang.String> paths)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<DataType>
handleFinalSet(TraversalStep traversalStep, java.lang.Object tree, java.lang.String key, DataType data)
Do a Shift style insert : 1) if there is no data "there", then just set it 2) if there is already a list "there", just add the data to the list 3) if there something other than a list there, grab it and stuff it and the data into a list and overwrite what is there with a list.-
Methods inherited from class com.bazaarvoice.jolt.traversr.SimpleTraversr
handleIntermediateGet
-
-
-
-
Method Detail
-
handleFinalSet
public Optional<DataType> handleFinalSet(TraversalStep traversalStep, java.lang.Object tree, java.lang.String key, DataType data)
Do a Shift style insert : 1) if there is no data "there", then just set it 2) if there is already a list "there", just add the data to the list 3) if there something other than a list there, grab it and stuff it and the data into a list and overwrite what is there with a list.- Overrides:
handleFinalSet
in classSimpleTraversr<DataType>
- Returns:
- the data object if the set was successful, or null if not
-
-