public class SimplePropertyRegistry extends java.lang.Object implements PropertyRegistry
Constructor and Description |
---|
SimplePropertyRegistry()
Creates a simple property registry.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkPropertyPermission(java.lang.String key,
java.lang.String action)
Checks that an action on a property is permitted.
|
java.lang.String |
getProperty(java.lang.String key)
Gets the value mapped with the specified key.
|
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue)
Gets the value mapped with the specified key or a default value.
|
java.lang.String |
removeProperty(java.lang.String key)
Removes a property.
|
java.lang.String |
setProperty(java.lang.String key,
java.lang.String value)
Sets a property that maps a key to a value.
|
public SimplePropertyRegistry()
@Nullable public java.lang.String getProperty(java.lang.String key)
PropertyLoader
getProperty
in interface PropertyLoader
key
- the key.null
if the property is not found.public java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
PropertyLoader
getProperty
in interface PropertyLoader
key
- the key.defaultValue
- the default value.@Nullable public java.lang.String setProperty(java.lang.String key, java.lang.String value)
PropertyRegistry
setProperty
in interface PropertyRegistry
key
- the key.value
- the value.null
if the property is not found.@Nullable public java.lang.String removeProperty(java.lang.String key)
PropertyRegistry
removeProperty
in interface PropertyRegistry
key
- the key.null
if the property is not found.protected void checkPropertyPermission(java.lang.String key, java.lang.String action)
key
- the property key.action
- the action.