public class Configuration
extends java.lang.Object
Constructor and Description |
---|
Configuration(play.api.Configuration conf)
Creates a new configuration from a Scala-based configuration.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Boolean |
getBoolean(java.lang.String key)
Retrieves a configuration value as a
Boolean . |
java.lang.Long |
getBytes(java.lang.String key)
Retrieves a configuration value as a
Bytes . |
Configuration |
getConfig(java.lang.String key)
Retrieves a sub-configuration, which is a configuration instance containing all keys that start with the given prefix.
|
java.lang.Integer |
getInt(java.lang.String key)
Retrieves a configuration value as an
Int . |
java.lang.Long |
getMilliseconds(java.lang.String key)
Retrieves a configuration value as a
Milliseconds . |
java.lang.String |
getString(java.lang.String key)
Retrieves a configuration value as a
String . |
java.util.Set<java.lang.String> |
keys()
Retrieves the set of keys available in this configuration.
|
java.lang.RuntimeException |
reportError(java.lang.String key,
java.lang.String message,
java.lang.Throwable e)
Creates a configuration error for a specific congiguration key.
|
static Configuration |
root()
The root configuration.
|
public Configuration(play.api.Configuration conf)
public static Configuration root()
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.Long getMilliseconds(java.lang.String key)
Milliseconds
.key
- configuration key (relative to configuration root key)null
public java.lang.Long getBytes(java.lang.String key)
Bytes
.key
- configuration key (relative to configuration root key)null
public java.lang.Integer getInt(java.lang.String key)
Int
.key
- configuration key (relative to configuration root key)null
public java.lang.Boolean getBoolean(java.lang.String key)
Boolean
.key
- configuration key (relative to configuration root key)null
public java.util.Set<java.lang.String> 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 exception