Class MutableConfigPropertiesImpl
- java.lang.Object
-
- com.devonfw.module.basic.common.api.config.SimpleConfigProperties
-
- com.devonfw.module.basic.common.api.config.MutableConfigPropertiesImpl
-
- All Implemented Interfaces:
ConfigProperties,MutableConfigProperties
class MutableConfigPropertiesImpl extends SimpleConfigProperties implements MutableConfigProperties
The implementation ofMutableConfigProperties.
-
-
Field Summary
Fields Modifier and Type Field Description private SimpleConfigPropertiescopyprivate intcopyModificationsprivate SimpleConfigPropertiesparentprivate intparentModifications-
Fields inherited from interface com.devonfw.module.basic.common.api.config.ConfigProperties
EMPTY, KEY_SEPARATOR
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMutableConfigPropertiesImpl(String key)The constructor.protectedMutableConfigPropertiesImpl(String key, ConfigProperties copy, ConfigProperties parent)The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SimpleConfigPropertiescreateChild(String key, boolean create)StringgetValue()MutableConfigPropertiesinherit(ConfigProperties parentNode)voidsetChildValue(String key, String value)voidsetValue(String value)protected voidupdateChildren()Updates the child-nodes in case of a mutable copy node.-
Methods inherited from class com.devonfw.module.basic.common.api.config.SimpleConfigProperties
asSimple, composeKey, fromFlatMap, fromHierarchicalMap, getChild, getChild, getChild, getChild, getChildKeys, getChildValue, getChildValue, getNodeKey, getNodeModifications, getValue, getValue, getValueAsBoolean, isEmpty, ofFlatMap, ofFlatMap, ofHierarchicalMap, ofHierarchicalMap, toFlatMap, toFlatMap, toHierarchicalMap, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.devonfw.module.basic.common.api.config.ConfigProperties
getChild, getChild, getChildKeys, getChildValue, getChildValue, getValue, getValue, getValueAsBoolean, isEmpty, toFlatMap, toFlatMap, toHierarchicalMap
-
-
-
-
Field Detail
-
parent
private final SimpleConfigProperties parent
-
copy
private final SimpleConfigProperties copy
-
copyModifications
private int copyModifications
-
parentModifications
private int parentModifications
-
-
Constructor Detail
-
MutableConfigPropertiesImpl
protected MutableConfigPropertiesImpl(String key)
The constructor.- Parameters:
key- the hierarchical key of thisConfigProperties-node.
-
MutableConfigPropertiesImpl
protected MutableConfigPropertiesImpl(String key, ConfigProperties copy, ConfigProperties parent)
The constructor.- Parameters:
key- the hierarchical key of thisConfigProperties-node.copy- theConfigProperties-node to copy withinheritancefrom the givenparent.parent- the parentConfigPropertiestoinherit fromornullfor none.
-
-
Method Detail
-
updateChildren
protected void updateChildren()
Description copied from class:SimpleConfigPropertiesUpdates the child-nodes in case of a mutable copy node.- Overrides:
updateChildrenin classSimpleConfigProperties
-
inherit
public MutableConfigProperties inherit(ConfigProperties parentNode)
- Specified by:
inheritin interfaceConfigProperties- Overrides:
inheritin classSimpleConfigProperties- Parameters:
parentNode- the parentConfigPropertiesto extend.- Returns:
- a new instance of
ConfigPropertieswith allchildrenandvalue(s) from thisConfigProperties-tree and allchildrenandvalue(s) inherited from the givenparentConfigProperties-tree if they are undefined in this tree.
-
getValue
public String getValue()
- Specified by:
getValuein interfaceConfigProperties- Overrides:
getValuein classSimpleConfigProperties- Returns:
- the value of this
ConfigProperties-node. May benull.
-
setValue
public void setValue(String value)
- Specified by:
setValuein interfaceMutableConfigProperties- Overrides:
setValuein classSimpleConfigProperties- Parameters:
value- new value ofSimpleConfigProperties.getValue().
-
setChildValue
public void setChildValue(String key, String value)
- Specified by:
setChildValuein interfaceMutableConfigProperties- Parameters:
key- the key of thechildwhere toset the value. All such children will be created if they do not yet exist.value- the new value toset.
-
createChild
protected SimpleConfigProperties createChild(String key, boolean create)
- Overrides:
createChildin classSimpleConfigProperties- Parameters:
key- the key segment of the child to create.create- -trueto force creation,falseotherwise.- Returns:
- the new child or
null.
-
-