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. Hide All
  2. Show all
  1. Configuration
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Configuration (underlying: Config)

    underlying

    the underlying Config implementation

Value Members

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

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

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

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

    Merge 2 configurations.

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

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

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

    Attributes
    final
    Definition Classes
    Any
  8. def canEqual (arg0: Any): Boolean

    Definition Classes
    Configuration → Equals
  9. def clone (): AnyRef

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

    Attributes
    final
    Definition Classes
    AnyRef
  11. def equals (arg0: Any): Boolean

    Definition Classes
    Configuration → Equals → AnyRef → Any
  12. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  13. 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.getString("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.

    returns

    a configuration value

  14. 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 configuratioon must be provided as:

    engine.maxSize = 512k
    
  15. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  16. 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.

    returns

    a new configuration

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

    returns

    a configuration value

  18. 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.getString("engine.timeout")
    

    The configuratioon must be provided as:

    engine.timeout = 1 second
    
  19. 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.

    validValues

    valid values for this configuration

    returns

    a configuration value

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

  21. def hashCode (): Int

    Definition Classes
    Configuration → AnyRef → Any
  22. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  23. 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

  24. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  25. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  26. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  27. def productArity : Int

    Definition Classes
    Configuration → Product
  28. def productElement (arg0: Int): Any

    Definition Classes
    Configuration → Product
  29. def productIterator : Iterator[Any]

    Definition Classes
    Product
  30. def productPrefix : String

    Definition Classes
    Configuration → Product
  31. 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!")
    
    message

    the error message

    e

    the related exception

    returns

    a configuration exception

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

  33. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  34. def toString (): String

    Definition Classes
    Configuration → AnyRef → Any
  35. val underlying : Config

    the underlying Config implementation

  36. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Deprecated Value Members

  1. def productElements : Iterator[Any]

    Definition Classes
    Product
    Annotations
    @deprecated
    Deprecated

    use productIterator instead

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any