public interface Document
| Modifier and Type | Method and Description |
|---|---|
Document |
add(java.lang.String path,
java.lang.Object value)
Add new property to a document by a given path.
|
java.lang.String |
asJson()
Json representation of Document.
|
java.util.Map<java.lang.String,java.lang.Object> |
asMap()
Map representation of Document.
|
java.lang.String |
asYaml()
YAML representation of Document.
|
Document |
delete(java.lang.String path)
Delete property from a document by a given path.
|
com.fasterxml.jackson.databind.JsonNode |
getDocument()
Get original document.
|
Document |
getMutatedDocument()
Returns a result document after all applied operations.
|
Document |
map(java.lang.String path,
MapFunction mapFunction)
Map a specific
MapFunction on a given path. |
Document |
put(java.lang.String path,
java.lang.String key,
java.lang.Object value)
Put a key/value pair to a document by a given json path.
|
java.util.List<java.lang.String> |
readPaths(java.lang.String path)
Read a list of strings from a document by a given json path.
|
default java.lang.Object |
readValue(java.lang.String path) |
<T> T |
readValue(java.lang.String path,
java.lang.Class<T> clazz)
Read value from a document by a given json path.
|
default java.util.List<java.lang.Object> |
readValues(java.lang.String path) |
<T> java.util.List<T> |
readValues(java.lang.String path,
java.lang.Class<T> clazz)
Read a list of values from a document by a given json path.
|
Document |
renameKey(java.lang.String path,
java.lang.String oldKeyName,
java.lang.String newKeyName)
Rename a key at a given json path.
|
Document |
set(java.lang.String path,
java.lang.Object value)
Set property to a document by a given path.
|
com.fasterxml.jackson.databind.JsonNode getDocument()
JsonNode<T> T readValue(java.lang.String path,
java.lang.Class<T> clazz)
T - a type of a valuepath - json path to read value from.clazz - a class of a value typedefault java.lang.Object readValue(java.lang.String path)
<T> java.util.List<T> readValues(java.lang.String path,
java.lang.Class<T> clazz)
T - a type of a valuepath - json path to read value from.clazz - a class of a value typedefault java.util.List<java.lang.Object> readValues(java.lang.String path)
java.util.List<java.lang.String> readPaths(java.lang.String path)
path - json path to read value from.Document set(java.lang.String path, java.lang.Object value)
path - json path of a propertyvalue - value to setDocument map(java.lang.String path, MapFunction mapFunction)
MapFunction on a given path.path - json path where function appliesmapFunction - value to setDocument delete(java.lang.String path)
path - json path of a propertyDocument add(java.lang.String path, java.lang.Object value)
path - json path of a propertyvalue - value to setDocument put(java.lang.String path, java.lang.String key, java.lang.Object value)
path - a json path of where new key should be addedkey - a key of a propertyvalue - a value of a propertyDocument renameKey(java.lang.String path, java.lang.String oldKeyName, java.lang.String newKeyName)
path - where the old key is locatedoldKeyName - old key to renamenewKeyName - a new key that old key should be changed tojava.util.Map<java.lang.String,java.lang.Object> asMap()
java.lang.String asJson()
java.lang.String asYaml()
Document getMutatedDocument()