Serializable, Iterable<PropertyValue>public final class ObjectValue extends PropertyValue
PropertyValue.ValueType| Modifier and Type | Method | Description |
|---|---|---|
ListValue |
addList(String key) |
Sets the given list value.
|
ObjectValue |
addObject(String key) |
Sets the given object vaöue.
|
protected ObjectValue |
deepClone() |
Creates a deep clone of this intance.
|
boolean |
equals(Object o) |
|
static ObjectValue |
from(Collection<PropertyValue> values) |
Merges multiple values into one single node.
|
Set<String> |
getKeys() |
Access the current present field names/keys.
|
<T extends PropertyValue> |
getOrSetValue(String name,
Supplier<T> valueSupplier) |
Get a single child getValue with the given name, creates it if not existing.
|
PropertyValue |
getPropertyValue(String name) |
Get a single child getValue by name.
|
int |
getSize() |
Get the value's number of elements.
|
String |
getValue() |
Get the node's createValue.
|
String |
getValue(String key) |
Get a String value with the given key, if possible.
|
Collection<PropertyValue> |
getValues() |
Get the fields of this instance.
|
PropertyValue.ValueType |
getValueType() |
Get the item's current value type.
|
int |
hashCode() |
|
Iterator<PropertyValue> |
iterator() |
|
ObjectValue |
mutable() |
Clones this instance and all it's children, marking as mutable value.
|
protected ObjectValue |
setPropertyValue(PropertyValue value) |
Adds another existing node, hereby setting the corresponding parent node.
|
PropertyValue |
setValue(String value) |
Sets the createValue.
|
ObjectValue |
setValue(String k,
String v) |
Sets the given key, value pair.
|
ObjectValue |
setValues(Map<String,String> config) |
Applies a mapProperties of
Map<String,String> to this instance as values. |
ObjectValue |
setValues(Map<String,String> config,
String source,
boolean overwriteExisting) |
Applies a mapProperties of
Map<String,String> to this instance as values. |
PropertyValue |
setValueWithCompositeKey(String key,
String value) |
Adds a new child getValue, where the getValue is given in '.'
|
Collection<PropertyValue> |
setValueWithCompositeKey(Map<String,String> values) |
Adds multiple values, where the keys are given in '.'
|
ListValue |
toListValue() |
Convert an instance to a List PropertyValue.
|
Map<String,String> |
toLocalMap() |
Convert the value tree to a local property map.
|
Map<String,String> |
toMap() |
Convert the value tree to a property map.
|
ObjectValue |
toObjectValue() |
Convert an instance to a Object PropertyValue.
|
String |
toString() |
Create a String representation of the tree.
|
forEach, spliteratorclone, finalize, getClass, notify, notifyAll, wait, wait, waitcheckImmutable, createList, createList, createObject, createObject, createValue, getKey, getMeta, getMeta, getMetaEntry, getParent, getQualifiedKey, getSource, getVersion, immutable, incrementVersion, isImmutable, isLeaf, isRoot, mapProperties, mapProperties, mapProperties, removeMeta, setKey, setMeta, setMeta, setParent, setVersionpublic PropertyValue.ValueType getValueType()
getValueType in class PropertyValuepublic Collection<PropertyValue> getValues()
public Set<String> getKeys()
public PropertyValue getPropertyValue(String name)
name - the child's name, not null.IllegalArgumentException - if multiple getPropertyValues with the given name are existing (ambigous).public String getValue()
getValue in class PropertyValuepublic PropertyValue setValue(String value)
PropertyValuesetValue in class PropertyValuevalue - the createValuePropertyValue.isImmutable()public String getValue(String key)
toString() method is used as a result.key - the key, not null.public <T extends PropertyValue> T getOrSetValue(String name, Supplier<T> valueSupplier)
T - the target type.name - the child's name, not null.valueSupplier - the supplier to create a new instance, if no value is present, not null.IllegalStateException - if the instance is immutable.PropertyValue.isImmutable()public int getSize()
getSize in class PropertyValuepublic ObjectValue setValues(Map<String,String> config)
Map<String,String> to this instance as values.config - the String based mapProperties, not null.public ObjectValue setValues(Map<String,String> config, String source, boolean overwriteExisting)
Map<String,String> to this instance as values.config - the String based mapProperties, not null.source - the source name, optional.overwriteExisting - if true, existing values will be overridden.public ObjectValue toObjectValue()
PropertyValuetoObjectValue in class PropertyValuepublic ListValue toListValue()
PropertyValuetoListValue in class PropertyValuepublic Iterator<PropertyValue> iterator()
iterator in interface Iterable<PropertyValue>iterator in class PropertyValueprotected ObjectValue setPropertyValue(PropertyValue value)
value - the value, not nullIllegalStateException - if the instance is immutable.PropertyValue.isImmutable()public ObjectValue setValue(String k, String v)
k - the key, not null.v - the value, not null.public ListValue addList(String key)
key - the key, not null.public ObjectValue addObject(String key)
key - the key, not null.public PropertyValue setValueWithCompositeKey(String key, String value)
a.b.c.key - the property key, e.g. a.b.cvalue - the property valueIllegalStateException - if the instance is immutable.PropertyValue.isImmutable()public Collection<PropertyValue> setValueWithCompositeKey(Map<String,String> values)
a.b.c.values - the values, not null.IllegalStateException - if the instance is immutable.PropertyValue.isImmutable()public Map<String,String> toMap()
toMap in class PropertyValuepublic Map<String,String> toLocalMap()
toLocalMap in class PropertyValuepublic ObjectValue mutable()
mutable in class PropertyValueprotected ObjectValue deepClone()
PropertyValuedeepClone in class PropertyValuepublic boolean equals(Object o)
equals in class PropertyValuepublic int hashCode()
hashCode in class PropertyValuepublic String toString()
PropertyValuetoString in class PropertyValuepublic static ObjectValue from(Collection<PropertyValue> values)
values - the values to merge, not null.Copyright © 2014–2019 Apache Software Foundation. All rights reserved.