public class MapTraversalStep<DataType> extends BaseTraversalStep<java.util.Map<java.lang.String,java.lang.Object>,DataType>
TraversalStep.Operation
child, traversr
Constructor and Description |
---|
MapTraversalStep(Traversr traversr,
TraversalStep child) |
Modifier and Type | Method and Description |
---|---|
Optional<DataType> |
get(java.util.Map<java.lang.String,java.lang.Object> map,
java.lang.String key)
Return the data for the key from the provided tree object.
|
java.lang.Class<?> |
getStepType()
Return the Class of the Generic T, so that it can be used in an
"instanceof" style check.
|
java.util.Map<java.lang.String,java.lang.Object> |
newContainer()
Create a new mutable Map or List, suitable for this PathElement to traverse.
|
Optional<DataType> |
overwriteSet(java.util.Map<java.lang.String,java.lang.Object> map,
java.lang.String key,
DataType data)
Insert the data into the tree, overwriting any data that is there.
|
Optional<DataType> |
remove(java.util.Map<java.lang.String,java.lang.Object> map,
java.lang.String key)
Remove and return the data for the key from the provided tree object.
|
getChild, traverse
public MapTraversalStep(Traversr traversr, TraversalStep child)
public java.lang.Class<?> getStepType()
TraversalStep
public java.util.Map<java.lang.String,java.lang.Object> newContainer()
TraversalStep
public Optional<DataType> get(java.util.Map<java.lang.String,java.lang.Object> map, java.lang.String key)
TraversalStep
public Optional<DataType> remove(java.util.Map<java.lang.String,java.lang.Object> map, java.lang.String key)
TraversalStep
public Optional<DataType> overwriteSet(java.util.Map<java.lang.String,java.lang.Object> map, java.lang.String key, DataType data)
TraversalStep