public interface DataSource
ConfigSource
, ConfigDiff
, TaskSource
, and TaskReport
.
It had two following methods that return Jackson's instances till v0.9, but they are removed so that Jackson on the core side can be hidden from plugins.
Iterable<Map.Entry<String, JsonNode>> getAttributes()
ObjectNode getObjectNode()
Modifier and Type | Method and Description |
---|---|
DataSource |
deepCopy()
Creates a deep copy of itself.
|
<E> E |
get(Class<E> type,
String attrName)
Returns an attribute value of
attrName as type . |
<E> E |
get(Class<E> type,
String attrName,
E defaultValue)
Returns an attribute value of
attrName as type . |
List<String> |
getAttributeNames()
Returns a
List of attribute names under this node. |
DataSource |
getNested(String attrName)
Returns a nested value under
attrName . |
DataSource |
getNestedOrGetEmpty(String attrName)
Returns a nested value under
attrName . |
DataSource |
getNestedOrSetEmpty(String attrName)
Returns a nested value under
attrName . |
boolean |
has(String attrName)
Returns
true if it has an attribute named attrName . |
boolean |
isEmpty()
Returns
true if it is empty. |
DataSource |
merge(DataSource other)
Merges another
DataSource into itself. |
DataSource |
remove(String attrName)
Removes the attribute named
attrName . |
DataSource |
set(String attrName,
Object v)
Sets a value for
attrName . |
DataSource |
setAll(DataSource other)
Sets all attributes in
other into itself. |
DataSource |
setNested(String attrName,
DataSource v)
Sets a nested value for
attrName . |
default String |
toJson()
Returns a JSON representation of itself.
|
List<String> getAttributeNames()
List
of attribute names under this node.List
of attribute namesboolean isEmpty()
true
if it is empty.true
if it is emptyboolean has(String attrName)
true
if it has an attribute named attrName
.attrName
- name of the attribute to look fortrue
if it has an attribute named attrName
<E> E get(Class<E> type, String attrName)
attrName
as type
.E
- the class to get the value astype
- the class to get the value asattrName
- name of the attribute to look forattrName
as type
<E> E get(Class<E> type, String attrName, E defaultValue)
attrName
as type
.E
- the class to get the value astype
- the class to get the value asattrName
- name of the attribute to look fordefaultValue
- the default value in case a value does not exist for attrName
attrName
as type
DataSource getNested(String attrName)
attrName
.attrName
- name of the nested attribute to look forattrName
DataSource getNestedOrSetEmpty(String attrName)
attrName
. Sets an empty object node "{}"
there if it is empty.attrName
- name of the nested attribute to look forattrName
DataSource getNestedOrGetEmpty(String attrName)
attrName
. Returns an empty object node "{}"
there if it is empty.attrName
- name of the nested attribute to look forattrName
DataSource set(String attrName, Object v)
attrName
.attrName
- name of the attribute to set the value atv
- the value Object
to setDataSource setNested(String attrName, DataSource v)
attrName
.attrName
- name of the attribute to set the nested value atv
- the nested value to setDataSource setAll(DataSource other)
other
into itself.other
- the other DataSource
to setDataSource remove(String attrName)
attrName
.attrName
- name of the attribute to removeDataSource deepCopy()
DataSource
instance that is deep-copied from itselfDataSource merge(DataSource other)
DataSource
into itself.other
- the other DataSource
to mergeDataSource
is merged