@NotThreadSafe public class ConfigProperties extends KeyedGroups
This class extends KeyedGroups by
providing property change listener and dictionary hierarchy support.
| Modifier and Type | Field and Description |
|---|---|
static ConfigProperties |
MISSING_CONFIG_PROPERTIES
Missing configuration properties.
|
static ConfigProperties[] |
NO_CONFIG_PROPERTIES
No configuration properties.
|
MISSING_KEYED_GROUP, NO_KEYED_GROUPSANONYMOUS, HASH_LOAD_FACTOR, MAP_ENTRY_COMPARATOR| Constructor and Description |
|---|
ConfigProperties()
Constructs an instance.
|
ConfigProperties(Messages.Entry type)
Constructs an instance.
|
ConfigProperties(Messages.Entry type,
Optional<String> name)
Constructs an instance.
|
ConfigProperties(Optional<String> name)
Constructs an instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(KeyedGroups otherInstance)
Adds all the properties from an other instance.
|
void |
add(Properties properties)
Adds properties.
|
void |
add(String key,
Object value)
Adds a keyed value.
|
void |
addPropertyChangeListener(String key,
PropertyChangeListener listener)
Adds a property change listener.
|
void |
clearOverriden()
Clears the overriden properties.
|
boolean |
containsGroupKey(String key)
Asks if the key is associated with a group.
|
boolean |
containsValueKey(String key)
Asks if the key is associated with a value.
|
ConfigProperties |
copy()
Creates a copy of this.
|
boolean |
equals(Object other) |
ConfigProperties |
freeze()
Freezes this.
|
ConfigProperties |
getGroup(String key)
Gets a group of keyed values.
|
KeyedGroups[] |
getGroups(String key)
Gets the groups for the specified key.
|
protected ConfigProperties |
getMissingGroup()
Gets the missing group.
|
protected ConfigProperties[] |
getNoGroups()
Gets no groups.
|
List<Object> |
getObjects(String key)
Gets the object list for a key.
|
Optional<ConfigProperties> |
getOverriden()
Gets the overriden properties.
|
Optional<ConfigProperties> |
getOverrider()
Gets the overrider properties.
|
int |
hashCode() |
boolean |
isEmpty()
Asks if this is empty.
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a property change Listener.
|
void |
restoreMonitoredValues(Object values)
Restores monitored values.
|
Object |
saveMonitoredValues()
Saves monitored values.
|
void |
setOverriden(ConfigProperties overriden)
Sets the overriden properties.
|
void |
setOverrider(ConfigProperties overrider)
Sets the overrider properties.
|
void |
setValue(String key,
Object value)
Sets a keyed value.
|
addAll, addGroup, clear, frozen, getGroupsEntries, getGroupsKeys, getGroupsSize, getName, isMissing, removeGroup, setGroup, thawed, toPropertiesMapaddAll, addObject, areValuesHidden, checkNotFrozen, getBoolean, getBoolean, getBoolean, getClassDef, getClassDef, getClassDefs, getDouble, getElapsed, getInt, getInteger, getLong, getLong, getObject, getPassword, getString, getString, getStrings, getThisLogger, getType, getValues, getValuesEntries, getValuesKeys, getValuesSize, hashCapacity, isFrozen, isHidden, isMultiple, removeValue, setHidden, setObjects, setValuesHidden, substitute, toStringpublic static final ConfigProperties MISSING_CONFIG_PROPERTIES
public static final ConfigProperties[] NO_CONFIG_PROPERTIES
public ConfigProperties()
public ConfigProperties(@Nonnull
Messages.Entry type)
type - The type of values (for logging purpose).public ConfigProperties(@Nonnull
Optional<String> name)
name - The optional name for the properties as a group.public ConfigProperties(@Nonnull
Messages.Entry type,
@Nonnull
Optional<String> name)
type - The type of values (for logging purpose).name - The optional name for the properties as a group.public void add(@Nonnull
KeyedGroups otherInstance)
The new values and groups are appended to those already present.
otherInstance - The other instance.public void add(@Nonnull
Properties properties)
The new properties are appended to those already present.
properties - The new properties.public void add(String key,
Object value)
If the key is already in the dictionary, the value is appended to the list of values for that key.
add in class KeyedValueskey - The value key.value - The value.public final void addPropertyChangeListener(@Nonnull
String key,
@Nonnull
PropertyChangeListener listener)
key - The key of the property to be monitored.listener - The listener.public void clearOverriden()
public final boolean containsGroupKey(String key)
containsGroupKey in class KeyedGroupskey - The key to look for.public final boolean containsValueKey(String key)
containsValueKey in class KeyedValueskey - The key to look for.public ConfigProperties copy()
copy in class KeyedGroupspublic final boolean equals(Object other)
equals in class KeyedGroups@Nonnull public ConfigProperties freeze()
freeze in class KeyedGroupspublic final ConfigProperties getGroup(String key)
getGroup in class KeyedGroupskey - The name of the group.public final KeyedGroups[] getGroups(String key)
getGroups in class KeyedGroupskey - The groups name.public final List<Object> getObjects(String key)
getObjects in class KeyedValueskey - The object key.@Nonnull @CheckReturnValue public final Optional<ConfigProperties> getOverriden()
@Nonnull @CheckReturnValue public final Optional<ConfigProperties> getOverrider()
public final int hashCode()
hashCode in class KeyedGroupspublic boolean isEmpty()
isEmpty in class KeyedGroupspublic final void removePropertyChangeListener(@Nonnull
PropertyChangeListener listener)
listener - The Listener.public final void restoreMonitoredValues(@Nonnull
Object values)
This is used by DocumentLoader to
restore dynamic properties at the end of an 'include' PI.
values - The opaque object containing the monitored values.@Nonnull @CheckReturnValue public final Object saveMonitoredValues()
This is used by DocumentLoader to
save dynamic properties at the beginning of an 'include' PI.
public void setOverriden(@Nonnull
ConfigProperties overriden)
overriden - The overriden properties.public void setOverrider(@Nonnull
ConfigProperties overrider)
overrider - The overrider properties.public void setValue(String key,
Object value)
If the key is already in the dictionary, its value is replaced.
setValue in class KeyedGroupskey - The value key.value - The value.protected final ConfigProperties getMissingGroup()
getMissingGroup in class KeyedGroupsprotected final ConfigProperties[] getNoGroups()
getNoGroups in class KeyedGroupsCopyright © 2003-2019 Serge Brisson. All Rights Reserved.