public abstract class AbstractConfigurable extends Object implements Configurable
A concrete version of this class needs to define the name,category, UUID string and the set of default values.
Modifier and Type | Field and Description |
---|---|
static String |
DELETED_VALUE_CODE |
Constructor and Description |
---|
AbstractConfigurable(ConfigurationManager configurationManager)
Constructs the AbstractConfigurable by either reading from a previously stored set of properties,
or by using the default values which results in them being stored for subsequent usage.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
void |
deleteProperty(String key)
Deletes a property value for a given key.
|
String |
getDefaultProperty(String key)
Provides the default property for a given key
|
Map<String,String> |
getInternalPropertyMap()
Provides access to the internal map.
|
Set<String> |
getKeys() |
String |
getProperty(String key)
Looks up the property for the given key.
|
List<String> |
getPropertyStringList(String key)
Returns an unmodifiable List
|
void |
restoreDefaults()
Restore the default property map
|
void |
setProperty(String key,
String value)
Overwrites or applies a new value against the given key in the property map.
|
void |
setPropertyStringList(String key,
List<String> value)
Set a value that is known to be a list.
|
protected void |
store() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCategory, getDefaultPropertyMap, getDisplayName, getFilePrefix, getUUID
public static final String DELETED_VALUE_CODE
public AbstractConfigurable(ConfigurationManager configurationManager)
public Set<String> getKeys()
getKeys
in interface Configurable
public String getProperty(String key)
Configurable
getProperty
in interface Configurable
public String getDefaultProperty(String key)
Configurable
getDefaultProperty
in interface Configurable
protected void store()
public void clear()
clear
in interface Configurable
public void setProperty(String key, String value)
Configurable
Configurable.deleteProperty(String)
setProperty
in interface Configurable
public Map<String,String> getInternalPropertyMap()
getInternalPropertyMap
in interface Configurable
public void restoreDefaults()
Configurable
restoreDefaults
in interface Configurable
public void deleteProperty(String key)
Configurable
Configurable.getProperty(String)
will return null.deleteProperty
in interface Configurable
public List<String> getPropertyStringList(String key)
getPropertyStringList(..).add("new element");which will not affect the stored list. For the property to be updated this
setPropertyStringList(String, List)
must be used.getPropertyStringList
in interface Configurable
public void setPropertyStringList(String key, List<String> value)
getPropertyStringList(String)
setPropertyStringList
in interface Configurable
Copyright © 2015–2016 The Apache Software Foundation. All rights reserved.