Config instead.@Singleton @Deprecated public class Configuration extends Object
| Constructor and Description |
|---|
Configuration(com.typesafe.config.Config conf)
Deprecated.
Creates a new configuration from a Typesafe Config object.
|
Configuration(play.api.Configuration conf)
Deprecated.
Creates a new configuration from a Scala-based configuration.
|
Configuration(Map<String,Object> conf)
Deprecated.
Creates a new configuration from a map.
|
Configuration(String s)
Deprecated.
Creates a new configuration by parsing a string in HOCON format.
|
| Modifier and Type | Method and Description |
|---|---|
Map<String,Object> |
asMap()
Deprecated.
Returns the config as a map of plain old Java maps, lists and values.
|
static Configuration |
empty()
Deprecated.
A new empty configuration.
|
Set<Map.Entry<String,com.typesafe.config.ConfigValue>> |
entrySet()
Deprecated.
Returns the config as a set of full paths to config values.
|
Boolean |
getBoolean(String key)
Deprecated.
Retrieves a configuration value as a
Boolean. |
Boolean |
getBoolean(String key,
Boolean defaultBoolean)
Deprecated.
Retrieves a configuration value as a
Boolean. |
List<Boolean> |
getBooleanList(String key)
Deprecated.
Retrieves a configuration value as a
List<Boolean>. |
List<Boolean> |
getBooleanList(String key,
List<Boolean> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Boolean>. |
Long |
getBytes(String key)
Deprecated.
Retrieves a configuration value as a
Bytes. |
Long |
getBytes(String key,
Long defaultBytes)
Deprecated.
Retrieves a configuration value as a
Bytes. |
List<Long> |
getBytesList(String key)
Deprecated.
Retrieves a configuration value as a
List<Long> representing bytes. |
List<Long> |
getBytesList(String key,
List<Long> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Long> representing bytes. |
Configuration |
getConfig(String key)
Deprecated.
Retrieves a sub-configuration, which is a configuration instance containing all keys that start with the given prefix.
|
List<Configuration> |
getConfigList(String key)
Deprecated.
Retrieves a configuration value as a
List<Configuration>. |
List<Configuration> |
getConfigList(String key,
List<Configuration> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Configuration>. |
Double |
getDouble(String key)
Deprecated.
Retrieves a configuration value as an
Double. |
Double |
getDouble(String key,
Double defaultDouble)
Deprecated.
Retrieves a configuration value as an
Double. |
List<Double> |
getDoubleList(String key)
Deprecated.
Retrieves a configuration value as a
List<Double>. |
List<Double> |
getDoubleList(String key,
List<Double> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Double>. |
Integer |
getInt(String key)
Deprecated.
Retrieves a configuration value as an
Int. |
Integer |
getInt(String key,
Integer defaultInteger)
Deprecated.
Retrieves a configuration value as an
Int. |
List<Integer> |
getIntList(String key)
Deprecated.
Retrieves a configuration value as a
List<Integer>. |
List<Integer> |
getIntList(String key,
List<Integer> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Integer>. |
List<Object> |
getList(String key)
Deprecated.
Retrieves a configuration value as a
List<Object>. |
List<Object> |
getList(String key,
List<Object> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Object>. |
Long |
getLong(String key)
Deprecated.
Retrieves a configuration value as an
Long. |
Long |
getLong(String key,
Long defaultLong)
Deprecated.
Retrieves a configuration value as an
Long. |
List<Long> |
getLongList(String key)
Deprecated.
Retrieves a configuration value as a
List<Long>. |
List<Long> |
getLongList(String key,
List<Long> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Long>. |
Long |
getMilliseconds(String key)
Deprecated.
Retrieves a configuration value as a
Milliseconds. |
Long |
getMilliseconds(String key,
Long defaultMilliseconds)
Deprecated.
Retrieves a configuration value as a
Milliseconds. |
List<Long> |
getMillisecondsList(String key)
Deprecated.
Retrieves a configuration value as a
List<Long> representing Milliseconds. |
List<Long> |
getMillisecondsList(String key,
List<Long> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Long> representing Milliseconds. |
Long |
getNanoseconds(String key)
Deprecated.
Retrieves a configuration value as a
Nanoseconds. |
Long |
getNanoseconds(String key,
Long defaultNanoseconds)
Deprecated.
Retrieves a configuration value as a
Nanoseconds. |
List<Long> |
getNanosecondsList(String key)
Deprecated.
Retrieves a configuration value as a
List<Long> representing Nanoseconds. |
List<Long> |
getNanosecondsList(String key,
List<Long> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Long> representing Nanoseconds. |
Number |
getNumber(String key)
Deprecated.
Retrieves a configuration value as an
Number. |
Number |
getNumber(String key,
Number defaultNumber)
Deprecated.
Retrieves a configuration value as an
Number. |
List<Number> |
getNumberList(String key)
Deprecated.
Retrieves a configuration value as a
List<Number>. |
List<Number> |
getNumberList(String key,
List<Number> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Number>. |
Object |
getObject(String key)
Deprecated.
Retrieves a configuration value as a
Object. |
Object |
getObject(String key,
Object defaultObject)
Deprecated.
Retrieves a configuration value as a
Object. |
List<Map<String,Object>> |
getObjectList(String key)
Deprecated.
Retrieves a configuration value as a
List<Map<String, Object>>. |
List<Map<String,Object>> |
getObjectList(String key,
List<Map<String,Object>> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Map<String, Object>>. |
String |
getString(String key)
Deprecated.
Retrieves a configuration value as a
String. |
String |
getString(String key,
String defaultString)
Deprecated.
Retrieves a configuration value as a
String. |
List<String> |
getStringList(String key)
Deprecated.
Retrieves a configuration value as a
List<String>. |
List<String> |
getStringList(String key,
List<String> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Number>. |
play.api.Configuration |
getWrappedConfiguration()
Deprecated.
|
Set<String> |
keys()
Deprecated.
Retrieves the set of keys available in this configuration.
|
static Configuration |
load(Environment env)
Deprecated.
Load a new configuration from an environment.
|
static Configuration |
reference()
Deprecated.
A new reference configuration.
|
RuntimeException |
reportError(String key,
String message,
Throwable e)
Deprecated.
Creates a configuration error for a specific configuration key.
|
static Configuration |
root()
Deprecated.
The root configuration.
|
Set<String> |
subKeys()
Deprecated.
Retrieves the set of direct sub-keys available in this configuration.
|
com.typesafe.config.Config |
underlying()
Deprecated.
Returns the underlying Typesafe config object.
|
Configuration |
withFallback(Configuration fallback)
Deprecated.
Extend this configuration with fallback configuration.
|
public Configuration(com.typesafe.config.Config conf)
conf - the typesafe configpublic Configuration(Map<String,Object> conf)
conf - the configuration mappublic Configuration(String s)
s - the HOCON-formatted string@Inject public Configuration(play.api.Configuration conf)
conf - the scala-based configurationpublic static Configuration root()
public static Configuration load(Environment env)
env - the environment used to initialize the created configpublic static Configuration empty()
public static Configuration reference()
public Configuration getConfig(String key)
key - The root prefix for this sub configuration.public String getString(String key)
String.key - configuration key (relative to configuration root key)nullpublic String getString(String key, String defaultString)
String.key - configuration key (relative to configuration root key)defaultString - default value if configuration key doesn't existpublic Long getMilliseconds(String key)
Milliseconds.key - configuration key (relative to configuration root key)nullpublic Long getMilliseconds(String key, Long defaultMilliseconds)
Milliseconds.key - configuration key (relative to configuration root key)defaultMilliseconds - default value if configuration key doesn't existpublic Long getNanoseconds(String key)
Nanoseconds.key - configuration key (relative to configuration root key)nullpublic Long getNanoseconds(String key, Long defaultNanoseconds)
Nanoseconds.key - configuration key (relative to configuration root key)defaultNanoseconds - default value if configuration key doesn't existpublic Long getBytes(String key)
Bytes.key - configuration key (relative to configuration root key)nullpublic Long getBytes(String key, Long defaultBytes)
Bytes.key - configuration key (relative to configuration root key)defaultBytes - default value if configuration key doesn't existpublic Double getDouble(String key)
Double.key - configuration key (relative to configuration root key)nullpublic Double getDouble(String key, Double defaultDouble)
Double.key - configuration key (relative to configuration root key)defaultDouble - default value if configuration key doesn't existpublic Integer getInt(String key)
Int.key - configuration key (relative to configuration root key)nullpublic Integer getInt(String key, Integer defaultInteger)
Int.key - configuration key (relative to configuration root key)defaultInteger - default value if configuration key doesn't existpublic Long getLong(String key)
Long.key - configuration key (relative to configuration root key)nullpublic Long getLong(String key, Long defaultLong)
Long.key - configuration key (relative to configuration root key)defaultLong - default value if configuration key doesn't existpublic Number getNumber(String key)
Number.key - configuration key (relative to configuration root key)nullpublic Number getNumber(String key, Number defaultNumber)
Number.key - configuration key (relative to configuration root key)defaultNumber - default value if configuration key doesn't existpublic Boolean getBoolean(String key)
Boolean.key - configuration key (relative to configuration root key)nullpublic Boolean getBoolean(String key, Boolean defaultBoolean)
Boolean.key - configuration key (relative to configuration root key)defaultBoolean - default value if configuration key doesn't existpublic Set<String> keys()
public Set<String> subKeys()
public Map<String,Object> asMap()
public com.typesafe.config.Config underlying()
public Set<Map.Entry<String,com.typesafe.config.ConfigValue>> entrySet()
asMap() in that it returns ConfigValue
objects, and keys are recursively expanded to be pull path keys.public RuntimeException reportError(String key, String message, Throwable e)
key - the configuration key, related to this errormessage - the error messagee - the optional related exceptionpublic List<Boolean> getBooleanList(String key)
List<Boolean>.key - configuration key (relative to configuration root key)nullpublic List<Boolean> getBooleanList(String key, List<Boolean> defaultList)
List<Boolean>.key - configuration key (relative to configuration root key)defaultList - default value if configuration key doesn't existpublic List<Long> getBytesList(String key)
List<Long> representing bytes.key - configuration key (relative to configuration root key)nullpublic List<Long> getBytesList(String key, List<Long> defaultList)
List<Long> representing bytes.key - configuration key (relative to configuration root key)defaultList - default value if configuration key doesn't existpublic List<Configuration> getConfigList(String key)
List<Configuration>.key - configuration key (relative to configuration root key)nullpublic List<Configuration> getConfigList(String key, List<Configuration> defaultList)
List<Configuration>.key - configuration key (relative to configuration root key)defaultList - default value if configuration key doesn't existpublic List<Double> getDoubleList(String key)
List<Double>.key - configuration key (relative to configuration root key)nullpublic List<Double> getDoubleList(String key, List<Double> defaultList)
List<Double>.key - configuration key (relative to configuration root key)defaultList - default value if configuration key doesn't existpublic List<Integer> getIntList(String key)
List<Integer>.key - configuration key (relative to configuration root key)nullpublic List<Integer> getIntList(String key, List<Integer> defaultList)
List<Integer>.key - configuration key (relative to configuration root key)defaultList - default value if configuration key doesn't existpublic List<Object> getList(String key)
List<Object>.key - configuration key (relative to configuration root key)nullpublic List<Object> getList(String key, List<Object> defaultList)
List<Object>.key - configuration key (relative to configuration root key)defaultList - default value if configuration key doesn't existpublic List<Long> getLongList(String key)
List<Long>.key - configuration key (relative to configuration root key)nullpublic List<Long> getLongList(String key, List<Long> defaultList)
List<Long>.key - configuration key (relative to configuration root key)defaultList - default value if configuration key doesn't existpublic List<Long> getMillisecondsList(String key)
List<Long> representing Milliseconds.key - configuration key (relative to configuration root key)nullpublic List<Long> getMillisecondsList(String key, List<Long> defaultList)
List<Long> representing Milliseconds.key - configuration key (relative to configuration root key)defaultList - default value if configuration key doesn't existpublic List<Long> getNanosecondsList(String key)
List<Long> representing Nanoseconds.key - configuration key (relative to configuration root key)nullpublic List<Long> getNanosecondsList(String key, List<Long> defaultList)
List<Long> representing Nanoseconds.key - configuration key (relative to configuration root key)defaultList - default value if configuration key doesn't existpublic List<Number> getNumberList(String key)
List<Number>.key - configuration key (relative to configuration root key)nullpublic List<Number> getNumberList(String key, List<Number> defaultList)
List<Number>.key - configuration key (relative to configuration root key)defaultList - default value if configuration key doesn't existpublic List<Map<String,Object>> getObjectList(String key)
List<Map<String, Object>>.key - configuration key (relative to configuration root key)nullpublic List<Map<String,Object>> getObjectList(String key, List<Map<String,Object>> defaultList)
List<Map<String, Object>>.key - configuration key (relative to configuration root key)defaultList - default value if configuration key doesn't existpublic List<String> getStringList(String key)
List<String>.key - configuration key (relative to configuration root key)nullpublic List<String> getStringList(String key, List<String> defaultList)
List<Number>.key - configuration key (relative to configuration root key)defaultList - default value if configuration key doesn't existpublic Object getObject(String key)
Object.key - configuration key (relative to configuration root key)nullpublic Object getObject(String key, Object defaultObject)
Object.key - configuration key (relative to configuration root key)defaultObject - default value if configuration key doesn't existpublic Configuration withFallback(Configuration fallback)
fallback - the configuration to fall back on if no value is found for a keypublic play.api.Configuration getWrappedConfiguration()