public interface TraversalStep<StepType,DataType>
Modifier and Type | Interface and Description |
---|---|
static class |
TraversalStep.Operation
The three things you can do with a Traversal.
|
Modifier and Type | Method and Description |
---|---|
Optional<DataType> |
get(StepType tree,
java.lang.String key)
Return the data for the key from the provided tree object.
|
TraversalStep |
getChild() |
java.lang.Class<?> |
getStepType()
Return the Class of the Generic T, so that it can be used in an
"instanceof" style check.
|
StepType |
newContainer()
Create a new mutable Map or List, suitable for this PathElement to traverse.
|
Optional<DataType> |
overwriteSet(StepType tree,
java.lang.String key,
DataType data)
Insert the data into the tree, overwriting any data that is there.
|
Optional<DataType> |
remove(StepType tree,
java.lang.String key)
Remove and return the data for the key from the provided tree object.
|
Optional<DataType> |
traverse(StepType tree,
TraversalStep.Operation op,
java.util.Iterator<java.lang.String> keys,
DataType data)
The meat of the Traversal.
|
Optional<DataType> get(StepType tree, java.lang.String key)
Optional<DataType> remove(StepType tree, java.lang.String key)
Optional<DataType> overwriteSet(StepType tree, java.lang.String key, DataType data)
TraversalStep getChild()
StepType newContainer()
java.lang.Class<?> getStepType()
Optional<DataType> traverse(StepType tree, TraversalStep.Operation op, java.util.Iterator<java.lang.String> keys, DataType data)
tree
- tree of data to walkop
- the Operation to perform is this is the last node of the Traversalkeys
- keys to usedata
- the data to place if the operation is SET