@Singleton
@Deprecated
public class Configuration
extends java.lang.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(java.util.Map<java.lang.String,java.lang.Object> conf)
Deprecated.
Creates a new configuration from a map.
|
Configuration(java.lang.String s)
Deprecated.
Creates a new configuration by parsing a string in HOCON format.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.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.
|
java.util.Set<java.util.Map.Entry<java.lang.String,com.typesafe.config.ConfigValue>> |
entrySet()
Deprecated.
Returns the config as a set of full paths to config values.
|
java.lang.Boolean |
getBoolean(java.lang.String key)
Deprecated.
Retrieves a configuration value as a
Boolean . |
java.lang.Boolean |
getBoolean(java.lang.String key,
java.lang.Boolean defaultBoolean)
Deprecated.
Retrieves a configuration value as a
Boolean . |
java.util.List<java.lang.Boolean> |
getBooleanList(java.lang.String key)
Deprecated.
Retrieves a configuration value as a
List<Boolean> . |
java.util.List<java.lang.Boolean> |
getBooleanList(java.lang.String key,
java.util.List<java.lang.Boolean> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Boolean> . |
java.lang.Long |
getBytes(java.lang.String key)
Deprecated.
Retrieves a configuration value as a
Bytes . |
java.lang.Long |
getBytes(java.lang.String key,
java.lang.Long defaultBytes)
Deprecated.
Retrieves a configuration value as a
Bytes . |
java.util.List<java.lang.Long> |
getBytesList(java.lang.String key)
Deprecated.
Retrieves a configuration value as a
List<Long> representing bytes. |
java.util.List<java.lang.Long> |
getBytesList(java.lang.String key,
java.util.List<java.lang.Long> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Long> representing bytes. |
Configuration |
getConfig(java.lang.String key)
Deprecated.
Retrieves a sub-configuration, which is a configuration instance containing all keys that start with the given prefix.
|
java.util.List<Configuration> |
getConfigList(java.lang.String key)
Deprecated.
Retrieves a configuration value as a
List<Configuration> . |
java.util.List<Configuration> |
getConfigList(java.lang.String key,
java.util.List<Configuration> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Configuration> . |
java.lang.Double |
getDouble(java.lang.String key)
Deprecated.
Retrieves a configuration value as an
Double . |
java.lang.Double |
getDouble(java.lang.String key,
java.lang.Double defaultDouble)
Deprecated.
Retrieves a configuration value as an
Double . |
java.util.List<java.lang.Double> |
getDoubleList(java.lang.String key)
Deprecated.
Retrieves a configuration value as a
List<Double> . |
java.util.List<java.lang.Double> |
getDoubleList(java.lang.String key,
java.util.List<java.lang.Double> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Double> . |
java.lang.Integer |
getInt(java.lang.String key)
Deprecated.
Retrieves a configuration value as an
Int . |
java.lang.Integer |
getInt(java.lang.String key,
java.lang.Integer defaultInteger)
Deprecated.
Retrieves a configuration value as an
Int . |
java.util.List<java.lang.Integer> |
getIntList(java.lang.String key)
Deprecated.
Retrieves a configuration value as a
List<Integer> . |
java.util.List<java.lang.Integer> |
getIntList(java.lang.String key,
java.util.List<java.lang.Integer> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Integer> . |
java.util.List<java.lang.Object> |
getList(java.lang.String key)
Deprecated.
Retrieves a configuration value as a
List<Object> . |
java.util.List<java.lang.Object> |
getList(java.lang.String key,
java.util.List<java.lang.Object> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Object> . |
java.lang.Long |
getLong(java.lang.String key)
Deprecated.
Retrieves a configuration value as an
Long . |
java.lang.Long |
getLong(java.lang.String key,
java.lang.Long defaultLong)
Deprecated.
Retrieves a configuration value as an
Long . |
java.util.List<java.lang.Long> |
getLongList(java.lang.String key)
Deprecated.
Retrieves a configuration value as a
List<Long> . |
java.util.List<java.lang.Long> |
getLongList(java.lang.String key,
java.util.List<java.lang.Long> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Long> . |
java.lang.Long |
getMilliseconds(java.lang.String key)
Deprecated.
Retrieves a configuration value as a
Milliseconds . |
java.lang.Long |
getMilliseconds(java.lang.String key,
java.lang.Long defaultMilliseconds)
Deprecated.
Retrieves a configuration value as a
Milliseconds . |
java.util.List<java.lang.Long> |
getMillisecondsList(java.lang.String key)
Deprecated.
Retrieves a configuration value as a
List<Long> representing Milliseconds. |
java.util.List<java.lang.Long> |
getMillisecondsList(java.lang.String key,
java.util.List<java.lang.Long> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Long> representing Milliseconds. |
java.lang.Long |
getNanoseconds(java.lang.String key)
Deprecated.
Retrieves a configuration value as a
Nanoseconds . |
java.lang.Long |
getNanoseconds(java.lang.String key,
java.lang.Long defaultNanoseconds)
Deprecated.
Retrieves a configuration value as a
Nanoseconds . |
java.util.List<java.lang.Long> |
getNanosecondsList(java.lang.String key)
Deprecated.
Retrieves a configuration value as a
List<Long> representing Nanoseconds. |
java.util.List<java.lang.Long> |
getNanosecondsList(java.lang.String key,
java.util.List<java.lang.Long> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Long> representing Nanoseconds. |
java.lang.Number |
getNumber(java.lang.String key)
Deprecated.
Retrieves a configuration value as an
Number . |
java.lang.Number |
getNumber(java.lang.String key,
java.lang.Number defaultNumber)
Deprecated.
Retrieves a configuration value as an
Number . |
java.util.List<java.lang.Number> |
getNumberList(java.lang.String key)
Deprecated.
Retrieves a configuration value as a
List<Number> . |
java.util.List<java.lang.Number> |
getNumberList(java.lang.String key,
java.util.List<java.lang.Number> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Number> . |
java.lang.Object |
getObject(java.lang.String key)
Deprecated.
Retrieves a configuration value as a
Object . |
java.lang.Object |
getObject(java.lang.String key,
java.lang.Object defaultObject)
Deprecated.
Retrieves a configuration value as a
Object . |
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
getObjectList(java.lang.String key)
Deprecated.
Retrieves a configuration value as a
List<Map<String, Object>> . |
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
getObjectList(java.lang.String key,
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Map<String, Object>> . |
java.lang.String |
getString(java.lang.String key)
Deprecated.
Retrieves a configuration value as a
String . |
java.lang.String |
getString(java.lang.String key,
java.lang.String defaultString)
Deprecated.
Retrieves a configuration value as a
String . |
java.util.List<java.lang.String> |
getStringList(java.lang.String key)
Deprecated.
Retrieves a configuration value as a
List<String> . |
java.util.List<java.lang.String> |
getStringList(java.lang.String key,
java.util.List<java.lang.String> defaultList)
Deprecated.
Retrieves a configuration value as a
List<Number> . |
play.api.Configuration |
getWrappedConfiguration()
Deprecated.
|
java.util.Set<java.lang.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.
|
java.lang.RuntimeException |
reportError(java.lang.String key,
java.lang.String message,
java.lang.Throwable e)
Deprecated.
Creates a configuration error for a specific configuration key.
|
static Configuration |
root()
Deprecated.
The root configuration.
|
java.util.Set<java.lang.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(java.util.Map<java.lang.String,java.lang.Object> conf)
conf
- the configuration mappublic Configuration(java.lang.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(java.lang.String key)
key
- The root prefix for this sub configuration.public java.lang.String getString(java.lang.String key)
String
.key
- configuration key (relative to configuration root key)null
public java.lang.String getString(java.lang.String key, java.lang.String defaultString)
String
.key
- configuration key (relative to configuration root key)defaultString
- default value if configuration key doesn't existpublic java.lang.Long getMilliseconds(java.lang.String key)
Milliseconds
.key
- configuration key (relative to configuration root key)null
public java.lang.Long getMilliseconds(java.lang.String key, java.lang.Long defaultMilliseconds)
Milliseconds
.key
- configuration key (relative to configuration root key)defaultMilliseconds
- default value if configuration key doesn't existpublic java.lang.Long getNanoseconds(java.lang.String key)
Nanoseconds
.key
- configuration key (relative to configuration root key)null
public java.lang.Long getNanoseconds(java.lang.String key, java.lang.Long defaultNanoseconds)
Nanoseconds
.key
- configuration key (relative to configuration root key)defaultNanoseconds
- default value if configuration key doesn't existpublic java.lang.Long getBytes(java.lang.String key)
Bytes
.key
- configuration key (relative to configuration root key)null
public java.lang.Long getBytes(java.lang.String key, java.lang.Long defaultBytes)
Bytes
.key
- configuration key (relative to configuration root key)defaultBytes
- default value if configuration key doesn't existpublic java.lang.Double getDouble(java.lang.String key)
Double
.key
- configuration key (relative to configuration root key)null
public java.lang.Double getDouble(java.lang.String key, java.lang.Double defaultDouble)
Double
.key
- configuration key (relative to configuration root key)defaultDouble
- default value if configuration key doesn't existpublic java.lang.Integer getInt(java.lang.String key)
Int
.key
- configuration key (relative to configuration root key)null
public java.lang.Integer getInt(java.lang.String key, java.lang.Integer defaultInteger)
Int
.key
- configuration key (relative to configuration root key)defaultInteger
- default value if configuration key doesn't existpublic java.lang.Long getLong(java.lang.String key)
Long
.key
- configuration key (relative to configuration root key)null
public java.lang.Long getLong(java.lang.String key, java.lang.Long defaultLong)
Long
.key
- configuration key (relative to configuration root key)defaultLong
- default value if configuration key doesn't existpublic java.lang.Number getNumber(java.lang.String key)
Number
.key
- configuration key (relative to configuration root key)null
public java.lang.Number getNumber(java.lang.String key, java.lang.Number defaultNumber)
Number
.key
- configuration key (relative to configuration root key)defaultNumber
- default value if configuration key doesn't existpublic java.lang.Boolean getBoolean(java.lang.String key)
Boolean
.key
- configuration key (relative to configuration root key)null
public java.lang.Boolean getBoolean(java.lang.String key, java.lang.Boolean defaultBoolean)
Boolean
.key
- configuration key (relative to configuration root key)defaultBoolean
- default value if configuration key doesn't existpublic java.util.Set<java.lang.String> keys()
public java.util.Set<java.lang.String> subKeys()
public java.util.Map<java.lang.String,java.lang.Object> asMap()
public com.typesafe.config.Config underlying()
public java.util.Set<java.util.Map.Entry<java.lang.String,com.typesafe.config.ConfigValue>> entrySet()
asMap()
in that it returns ConfigValue
objects, and keys are recursively expanded to be pull path keys.public java.lang.RuntimeException reportError(java.lang.String key, java.lang.String message, java.lang.Throwable e)
key
- the configuration key, related to this errormessage
- the error messagee
- the optional related exceptionpublic java.util.List<java.lang.Boolean> getBooleanList(java.lang.String key)
List<Boolean>
.key
- configuration key (relative to configuration root key)null
public java.util.List<java.lang.Boolean> getBooleanList(java.lang.String key, java.util.List<java.lang.Boolean> defaultList)
List<Boolean>
.key
- configuration key (relative to configuration root key)defaultList
- default value if configuration key doesn't existpublic java.util.List<java.lang.Long> getBytesList(java.lang.String key)
List<Long>
representing bytes.key
- configuration key (relative to configuration root key)null
public java.util.List<java.lang.Long> getBytesList(java.lang.String key, java.util.List<java.lang.Long> defaultList)
List<Long>
representing bytes.key
- configuration key (relative to configuration root key)defaultList
- default value if configuration key doesn't existpublic java.util.List<Configuration> getConfigList(java.lang.String key)
List<Configuration>
.key
- configuration key (relative to configuration root key)null
public java.util.List<Configuration> getConfigList(java.lang.String key, java.util.List<Configuration> defaultList)
List<Configuration>
.key
- configuration key (relative to configuration root key)defaultList
- default value if configuration key doesn't existpublic java.util.List<java.lang.Double> getDoubleList(java.lang.String key)
List<Double>
.key
- configuration key (relative to configuration root key)null
public java.util.List<java.lang.Double> getDoubleList(java.lang.String key, java.util.List<java.lang.Double> defaultList)
List<Double>
.key
- configuration key (relative to configuration root key)defaultList
- default value if configuration key doesn't existpublic java.util.List<java.lang.Integer> getIntList(java.lang.String key)
List<Integer>
.key
- configuration key (relative to configuration root key)null
public java.util.List<java.lang.Integer> getIntList(java.lang.String key, java.util.List<java.lang.Integer> defaultList)
List<Integer>
.key
- configuration key (relative to configuration root key)defaultList
- default value if configuration key doesn't existpublic java.util.List<java.lang.Object> getList(java.lang.String key)
List<Object>
.key
- configuration key (relative to configuration root key)null
public java.util.List<java.lang.Object> getList(java.lang.String key, java.util.List<java.lang.Object> defaultList)
List<Object>
.key
- configuration key (relative to configuration root key)defaultList
- default value if configuration key doesn't existpublic java.util.List<java.lang.Long> getLongList(java.lang.String key)
List<Long>
.key
- configuration key (relative to configuration root key)null
public java.util.List<java.lang.Long> getLongList(java.lang.String key, java.util.List<java.lang.Long> defaultList)
List<Long>
.key
- configuration key (relative to configuration root key)defaultList
- default value if configuration key doesn't existpublic java.util.List<java.lang.Long> getMillisecondsList(java.lang.String key)
List<Long>
representing Milliseconds.key
- configuration key (relative to configuration root key)null
public java.util.List<java.lang.Long> getMillisecondsList(java.lang.String key, java.util.List<java.lang.Long> defaultList)
List<Long>
representing Milliseconds.key
- configuration key (relative to configuration root key)defaultList
- default value if configuration key doesn't existpublic java.util.List<java.lang.Long> getNanosecondsList(java.lang.String key)
List<Long>
representing Nanoseconds.key
- configuration key (relative to configuration root key)null
public java.util.List<java.lang.Long> getNanosecondsList(java.lang.String key, java.util.List<java.lang.Long> defaultList)
List<Long>
representing Nanoseconds.key
- configuration key (relative to configuration root key)defaultList
- default value if configuration key doesn't existpublic java.util.List<java.lang.Number> getNumberList(java.lang.String key)
List<Number>
.key
- configuration key (relative to configuration root key)null
public java.util.List<java.lang.Number> getNumberList(java.lang.String key, java.util.List<java.lang.Number> defaultList)
List<Number>
.key
- configuration key (relative to configuration root key)defaultList
- default value if configuration key doesn't existpublic java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getObjectList(java.lang.String key)
List<Map<String, Object>>
.key
- configuration key (relative to configuration root key)null
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getObjectList(java.lang.String key, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> defaultList)
List<Map<String, Object>>
.key
- configuration key (relative to configuration root key)defaultList
- default value if configuration key doesn't existpublic java.util.List<java.lang.String> getStringList(java.lang.String key)
List<String>
.key
- configuration key (relative to configuration root key)null
public java.util.List<java.lang.String> getStringList(java.lang.String key, java.util.List<java.lang.String> defaultList)
List<Number>
.key
- configuration key (relative to configuration root key)defaultList
- default value if configuration key doesn't existpublic java.lang.Object getObject(java.lang.String key)
Object
.key
- configuration key (relative to configuration root key)null
public java.lang.Object getObject(java.lang.String key, java.lang.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()