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

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. final def ==(arg0: AnyRef): Boolean

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

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

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  9. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. 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

  11. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  12. 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.getSub("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

  13. 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

  14. 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
  15. 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

  16. 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

  17. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  21. 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

  22. 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

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

    Definition Classes
    AnyRef
  24. val underlying: Config

    the underlying Config implementation

  25. final def wait(): Unit

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. 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