play.api

Configuration

case class Configuration(underlying: Config) extends Product with Serializable

A full configuration set.

The underlying implementation is provided by https://github.com/typesafehub/config.

underlying

the underlying Config implementation

Source
Configuration.scala
Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Configuration
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Configuration(underlying: Config)

    underlying

    the underlying Config implementation

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def ++(other: Configuration): Configuration

    Merge 2 configurations.

  5. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  6. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def entrySet: Set[(String, ConfigValue)]

    Returns every path as a set of key to value pairs, by recursively iterating through the config objects.

  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def getBoolean(path: String): Option[Boolean]

    Retrieves a configuration value as a Boolean.

    Retrieves a configuration value as a Boolean.

    For example:

    val configuration = Configuration.load()
    val isEnabled = configuration.getBoolean("engine.isEnabled")

    A configuration error will be thrown if the configuration value is not a valid Boolean. Authorized vales are yes/no or true/false.

    path

    the configuration key, relative to the configuration root key

    returns

    a configuration value

  13. def getBooleanList(path: String): Option[List[Boolean]]

    Retrieves a configuration value as a List of Boolean.

    Retrieves a configuration value as a List of Boolean.

    For example:

    val configuration = Configuration.load()
    val switches = configuration.getBooleanList("board.switches")

    The configuration must be provided as:

    board.switches = [true, true, false]

    A configuration error will be thrown if the configuration value is not a valid Boolean. Authorized vales are yes/no or true/false.

  14. def getBooleanSeq(path: String): Option[Seq[Boolean]]

    Retrieves a configuration value as a Seq of Boolean.

    Retrieves a configuration value as a Seq of Boolean.

    For example:

    val configuration = Configuration.load()
    val switches = configuration.getBooleanSeq("board.switches")

    The configuration must be provided as:

    board.switches = [true, true, false]

    A configuration error will be thrown if the configuration value is not a valid Boolean. Authorized vales are yes/no or true/false.

  15. def getBytes(path: String): Option[Long]

    Retrieves a configuration value as Bytes.

    Retrieves a configuration value as Bytes.

    For example:

    val configuration = Configuration.load()
    val maxSize = configuration.getString("engine.maxSize")

    The configuration must be provided as:

    engine.maxSize = 512k
  16. def getBytesList(path: String): Option[List[Long]]

    Retrieves a configuration value as a List of Bytes.

    Retrieves a configuration value as a List of Bytes.

    For example:

    val configuration = Configuration.load()
    val maxSizes = configuration.getBytesList("engine.maxSizes")

    The configuration must be provided as:

    engine.maxSizes = [512k, 256k, 256k]
  17. def getBytesSeq(path: String): Option[Seq[Long]]

    Retrieves a configuration value as a Seq of Bytes.

    Retrieves a configuration value as a Seq of Bytes.

    For example:

    val configuration = Configuration.load()
    val maxSizes = configuration.getBytesSeq("engine.maxSizes")

    The configuration must be provided as:

    engine.maxSizes = [512k, 256k, 256k]
  18. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  19. def getConfig(path: String): Option[Configuration]

    Retrieves a sub-configuration, i.

    Retrieves a sub-configuration, i.e. a configuration instance containing all keys starting with a given prefix.

    For example:

    val configuration = Configuration.load()
    val engineConfig = configuration.getConfig("engine")

    The root key of this new configuration will be ‘engine’, and you can access any sub-keys relatively.

    path

    the root prefix for this sub-configuration

    returns

    a new configuration

  20. def getConfigList(path: String): Option[List[Configuration]]

    Retrieves a List of sub-configurations, i.

    Retrieves a List of sub-configurations, i.e. a configuration instance for each key that matches the path.

    For example:

    val configuration = Configuration.load()
    val engineConfigs = configuration.getConfigList("engine")

    The root key of this new configuration will be "engine", and you can access any sub-keys relatively.

  21. def getConfigSeq(path: String): Option[Seq[Configuration]]

    Retrieves a Seq of sub-configurations, i.

    Retrieves a Seq of sub-configurations, i.e. a configuration instance for each key that matches the path.

    For example:

    val configuration = Configuration.load()
    val engineConfigs = configuration.getConfigSeq("engine")

    The root key of this new configuration will be "engine", and you can access any sub-keys relatively.

  22. def getDouble(path: String): Option[Double]

    Retrieves a configuration value as a Double.

    Retrieves a configuration value as a Double.

    For example:

    val configuration = Configuration.load()
    val population = configuration.getDouble("world.population")

    A configuration error will be thrown if the configuration value is not a valid Double.

    path

    the configuration key, relative to the configuration root key

    returns

    a configuration value

  23. def getDoubleList(path: String): Option[List[Double]]

    Retrieves a configuration value as a List of Double.

    Retrieves a configuration value as a List of Double.

    For example:

    val configuration = Configuration.load()
    val maxSizes = configuration.getDoubleList("engine.maxSizes")

    The configuration must be provided as:

    engine.maxSizes = [5.0, 3.34, 2.6]
  24. def getDoubleSeq(path: String): Option[Seq[Double]]

    Retrieves a configuration value as a Seq of Double.

    Retrieves a configuration value as a Seq of Double.

    For example:

    val configuration = Configuration.load()
    val maxSizes = configuration.getDoubleSeq("engine.maxSizes")

    The configuration must be provided as:

    engine.maxSizes = [5.0, 3.34, 2.6]
  25. def getInt(path: String): Option[Int]

    Retrieves a configuration value as an Int.

    Retrieves a configuration value as an Int.

    For example:

    val configuration = Configuration.load()
    val poolSize = configuration.getInt("engine.pool.size")

    A configuration error will be thrown if the configuration value is not a valid Int.

    path

    the configuration key, relative to the configuration root key

    returns

    a configuration value

  26. def getIntList(path: String): Option[List[Integer]]

    Retrieves a configuration value as a List of Integer.

    Retrieves a configuration value as a List of Integer.

    For example:

    val configuration = Configuration.load()
    val maxSizes = configuration.getIntList("engine.maxSizes")

    The configuration must be provided as:

    engine.maxSizes = [100, 500, 2]
  27. def getIntSeq(path: String): Option[Seq[Integer]]

    Retrieves a configuration value as a Seq of Integer.

    Retrieves a configuration value as a Seq of Integer.

    For example:

    val configuration = Configuration.load()
    val maxSizes = configuration.getIntSeq("engine.maxSizes")

    The configuration must be provided as:

    engine.maxSizes = [100, 500, 2]
  28. def getList(path: String): Option[ConfigList]

    Gets a list value (with any element type) as a ConfigList, which implements java.

    Gets a list value (with any element type) as a ConfigList, which implements java.util.List<ConfigValue>.

    For example:

    val configuration = Configuration.load()
    val maxSizes = configuration.getList("engine.maxSizes")

    The configuration must be provided as:

    engine.maxSizes = ["foo", "bar"]
  29. def getLong(path: String): Option[Long]

    Retrieves a configuration value as a Long.

    Retrieves a configuration value as a Long.

    For example:

    val configuration = Configuration.load()
    val duration = configuration.getLong("timeout.duration")

    A configuration error will be thrown if the configuration value is not a valid Long.

    path

    the configuration key, relative to the configuration root key

    returns

    a configuration value

  30. def getLongList(path: String): Option[List[Long]]

    Retrieves a configuration value as a List of Long.

    Retrieves a configuration value as a List of Long.

    For example:

    val configuration = Configuration.load()
    val maxSizes = configuration.getLongList("engine.maxSizes")

    The configuration must be provided as:

    engine.maxSizes = [10000000000000, 500, 2000]
  31. def getLongSeq(path: String): Option[Seq[Long]]

    Retrieves a configuration value as a Seq of Long.

    Retrieves a configuration value as a Seq of Long.

    For example:

    val configuration = Configuration.load()
    val maxSizes = configuration.getLongSeq("engine.maxSizes")

    The configuration must be provided as:

    engine.maxSizes = [10000000000000, 500, 2000]
  32. def getMilliseconds(path: String): Option[Long]

    Retrieves a configuration value as Milliseconds.

    Retrieves a configuration value as Milliseconds.

    For example:

    val configuration = Configuration.load()
    val timeout = configuration.getMilliseconds("engine.timeout")

    The configuration must be provided as:

    engine.timeout = 1 second
  33. def getMillisecondsList(path: String): Option[List[Long]]

    Retrieves a configuration value as List of Milliseconds.

    Retrieves a configuration value as List of Milliseconds.

    For example:

    val configuration = Configuration.load()
    val timeouts = configuration.getMillisecondsList("engine.timeouts")

    The configuration must be provided as:

    engine.timeouts = [1 second, 1 second]
  34. def getMillisecondsSeq(path: String): Option[Seq[Long]]

    Retrieves a configuration value as Seq of Milliseconds.

    Retrieves a configuration value as Seq of Milliseconds.

    For example:

    val configuration = Configuration.load()
    val timeouts = configuration.getMillisecondsSeq("engine.timeouts")

    The configuration must be provided as:

    engine.timeouts = [1 second, 1 second]
  35. def getNanoseconds(path: String): Option[Long]

    Retrieves a configuration value as Nanoseconds.

    Retrieves a configuration value as Nanoseconds.

    For example:

    val configuration = Configuration.load()
    val timeout = configuration.getNanoseconds("engine.timeout")

    The configuration must be provided as:

    engine.timeout = 1 second
  36. def getNanosecondsList(path: String): Option[List[Long]]

    Retrieves a configuration value as List of Nanoseconds.

    Retrieves a configuration value as List of Nanoseconds.

    For example:

    val configuration = Configuration.load()
    val timeouts = configuration.getNanosecondsList("engine.timeouts")

    The configuration must be provided as:

    engine.timeouts = [1 second, 1 second]
  37. def getNanosecondsSeq(path: String): Option[Seq[Long]]

    Retrieves a configuration value as Seq of Nanoseconds.

    Retrieves a configuration value as Seq of Nanoseconds.

    For example:

    val configuration = Configuration.load()
    val timeouts = configuration.getNanosecondsSeq("engine.timeouts")

    The configuration must be provided as:

    engine.timeouts = [1 second, 1 second]
  38. def getNumber(path: String): Option[Number]

    Retrieves a configuration value as a Number.

    Retrieves a configuration value as a Number.

    For example:

    val configuration = Configuration.load()
    val counter = configuration.getNumber("foo.counter")

    A configuration error will be thrown if the configuration value is not a valid Number.

    path

    the configuration key, relative to the configuration root key

    returns

    a configuration value

  39. def getNumberList(path: String): Option[List[Number]]

    Retrieves a configuration value as a List of Number.

    Retrieves a configuration value as a List of Number.

    For example:

    val configuration = Configuration.load()
    val maxSizes = configuration.getNumberList("engine.maxSizes")

    The configuration must be provided as:

    engine.maxSizes = [50, 500, 5000]
  40. def getNumberSeq(path: String): Option[Seq[Number]]

    Retrieves a configuration value as a Seq of Number.

    Retrieves a configuration value as a Seq of Number.

    For example:

    val configuration = Configuration.load()
    val maxSizes = configuration.getNumberSeq("engine.maxSizes")

    The configuration must be provided as:

    engine.maxSizes = [50, 500, 5000]
  41. def getObject(path: String): Option[ConfigObject]

    Retrieves a ConfigObject for this path, which implements Map<String,ConfigValue>

    Retrieves a ConfigObject for this path, which implements Map<String,ConfigValue>

    For example:

    val configuration = Configuration.load()
    val engineProperties = configuration.getObject("engine.properties")

    The configuration must be provided as:

    engine.properties = {id: 1, power: 5}
  42. def getObjectList(path: String): Option[List[_ <: ConfigObject]]

    Retrieves a configuration value as a List of ConfigObject.

    Retrieves a configuration value as a List of ConfigObject.

    For example:

    val configuration = Configuration.load()
    val engineProperties = configuration.getObjectList("engine.properties")

    The configuration must be provided as:

    engine.properties = [{id: 5, power: 3}, {id: 6, power: 20}]
  43. def getString(path: String, validValues: Option[Set[String]] = None): Option[String]

    Retrieves a configuration value as a String.

    Retrieves a configuration value as a String.

    This method supports an optional set of valid values:

    val config = Configuration.load()
    val mode = config.getString("engine.mode", Some(Set("dev","prod")))

    A configuration error will be thrown if the configuration value does not match any of the required values.

    path

    the configuration key, relative to configuration root key

    validValues

    valid values for this configuration

    returns

    a configuration value

  44. def getStringList(path: String): Option[List[String]]

    Retrieves a configuration value as a List of String.

    Retrieves a configuration value as a List of String.

    For example:

    val configuration = Configuration.load()
    val names = configuration.getStringList("names")

    The configuration must be provided as:

    names = ["Jim", "Bob", "Steve"]
  45. def getStringSeq(path: String): Option[Seq[String]]

    Retrieves a configuration value as a Seq of String.

    Retrieves a configuration value as a Seq of String.

    For example:

    val configuration = Configuration.load()
    val names = configuration.getStringSeq("names")

    The configuration must be provided as:

    names = ["Jim", "Bob", "Steve"]
  46. def globalError(message: String, e: Option[Throwable] = None): PlayException

    Creates a configuration error for this configuration.

    Creates a configuration error for this configuration.

    For example:

    val configuration = Configuration.load()
    throw configuration.globalError("Missing configuration key: [yop.url]")
    message

    the error message

    e

    the related exception

    returns

    a configuration exception

  47. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  48. def keys: Set[String]

    Returns available keys.

    Returns available keys.

    For example:

    val configuration = Configuration.load()
    val keys = configuration.keys
    returns

    the set of keys available in this configuration

  49. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  50. final def notify(): Unit

    Definition Classes
    AnyRef
  51. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  52. def reportError(path: String, message: String, e: Option[Throwable] = None): PlayException

    Creates a configuration error for a specific configuration key.

    Creates a configuration error for a specific configuration key.

    For example:

    val configuration = Configuration.load()
    throw configuration.reportError("engine.connectionUrl", "Cannot connect!")
    path

    the configuration key, related to this error

    message

    the error message

    e

    the related exception

    returns

    a configuration exception

  53. def subKeys: Set[String]

    Returns sub-keys.

    Returns sub-keys.

    For example:

    val configuration = Configuration.load()
    val subKeys = configuration.subKeys
    returns

    the set of direct sub-keys available in this configuration

  54. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  55. val underlying: Config

    the underlying Config implementation

  56. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  57. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  58. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped