public class Configurations
extends java.lang.Object
Constructor and Description |
---|
Configurations() |
Modifier and Type | Method and Description |
---|---|
static ConfigurationArray |
emptyArray()
Get an empty array.
|
static Configuration |
emptyConfiguration()
Get an empty configuration.
|
static Configuration |
getActiveConfiguration()
Get the currently active configuration.
|
static ConfigurationBuilder |
getBuilder()
Returns a new ConfigurationBuilder instance.
|
static Configuration |
getConfiguration(java.lang.Object key)
Get the configuration for the given key.
|
static java.util.Collection<java.lang.Object> |
getConfigurationKeys()
Get all keys which are mapped to a configuration.
|
static Configuration |
getOrEmpty(ConfigurationArray from,
int index)
Tries to get a configuration from the given array.
|
static Configuration |
getOrEmpty(Configuration from,
java.lang.String property)
Tries to get an inner configuration from the given configuration.
|
static Configuration |
getOrEmpty(java.lang.String property)
Equal to calling
getOrEmpty(Configuration, String) with the currently active configuration
getActiveConfiguration() . |
static ConfigurationArray |
getOrEmptyArray(ConfigurationArray from,
int index)
Tries to get an array from the given array.
|
static ConfigurationArray |
getOrEmptyArray(Configuration from,
java.lang.String property)
Tries to get an array from the given configuration.
|
static ConfigurationArray |
getOrEmptyArray(java.lang.String property)
Equal to calling
getOrEmptyArray(String) with the currently active configuration
getActiveConfiguration() . |
static EditableConfiguration |
makeEditable(Configuration configuration)
Returns an editable version of the given configuration.
|
static EditableConfigurationArray |
makeEditable(ConfigurationArray array)
Returns an editable version of the given array.
|
static void |
setActiveConfiguration(Configuration configuration)
Set the currently active configuration.
|
static void |
setConfiguration(java.lang.Object key,
Configuration configuration)
Set the configuration for the given key.
|
public static EditableConfiguration makeEditable(Configuration configuration)
configuration
- The configuration to be made editable. May be null.public static EditableConfigurationArray makeEditable(ConfigurationArray array)
array
- The array to be made editable. May be null.public static void setActiveConfiguration(Configuration configuration)
configuration
- The new active configuration.public static Configuration getActiveConfiguration()
public static void setConfiguration(java.lang.Object key, Configuration configuration)
key
- The key to set the configuration for.configuration
- The new configuration. May not be null.public static Configuration getConfiguration(java.lang.Object key)
key
- The key to get the configuration for.public static java.util.Collection<java.lang.Object> getConfigurationKeys()
getConfiguration(Object)
will not return
null for these keys.public static Configuration emptyConfiguration()
public static ConfigurationArray emptyArray()
public static Configuration getOrEmpty(Configuration from, java.lang.String property)
from
- The configuration to get the inner configuration from.property
- The name of the property to get the inner configuration from.public static Configuration getOrEmpty(java.lang.String property)
getOrEmpty(Configuration, String)
with the currently active configuration
getActiveConfiguration()
.public static Configuration getOrEmpty(ConfigurationArray from, int index)
from
- The array to get the configuration from.index
- The index to get the inner configuration from.public static ConfigurationArray getOrEmptyArray(Configuration from, java.lang.String property)
from
- The configuration to get the array from.property
- The name of the property to get the array from.public static ConfigurationArray getOrEmptyArray(java.lang.String property)
getOrEmptyArray(String)
with the currently active configuration
getActiveConfiguration()
.public static ConfigurationArray getOrEmptyArray(ConfigurationArray from, int index)
from
- The array to get the array from.index
- The index to get the array from.public static ConfigurationBuilder getBuilder()