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