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,
String key)
Return the data for the key from the provided tree object.
|
TraversalStep |
getChild() |
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,
String key,
DataType data)
Insert the data into the tree, overwriting any data that is there.
|
Optional<DataType> |
remove(StepType tree,
String key)
Remove and return the data for the key from the provided tree object.
|
Optional<DataType> |
traverse(StepType tree,
TraversalStep.Operation op,
Iterator<String> keys,
DataType data)
The meat of the Traversal.
|
Optional<DataType> get(StepType tree, String key)
Optional<DataType> remove(StepType tree, String key)
Optional<DataType> overwriteSet(StepType tree, String key, DataType data)
TraversalStep getChild()
StepType newContainer()
Class<?> getStepType()
Optional<DataType> traverse(StepType tree, TraversalStep.Operation op, Iterator<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 SETCopyright © 2023. All rights reserved.