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>
Traverser that does not overwrite data.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandleFinalSet
(TraversalStep traversalStep, Object tree, 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
-
Constructor Details
-
ShiftrTraversr
-
ShiftrTraversr
-
-
Method Details
-
handleFinalSet
public Optional<DataType> handleFinalSet(TraversalStep traversalStep, Object tree, 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
-