EnrichedConfig

class EnrichedConfig(val underlying: Config)

Based on PlayConfig, adds some helper methods over underlying Config.

Companion
object
class Object
trait Matchable
class Any

Value members

Concrete methods

def get[A](path: String)(implicit loader: ConfigLoader[A]): A

Get the config at the given path.

Get the config at the given path.

def getDeprecated[A](path: String, deprecated: String)(implicit evidence$3: ConfigLoader[A]): A

Get a deprecated configuration item.

Get a deprecated configuration item.

If the deprecated configuration item is defined, it will be returned, and a warning will be logged.

Otherwise, the configuration from path will be looked up.

def getDeprecatedWithFallback(path: String, deprecated: String, parent: String): EnrichedConfig

Get a deprecated configuration.

Get a deprecated configuration.

If the deprecated configuration is defined, it will be returned, falling back to the new configuration, and a warning will be logged.

Otherwise, the configuration from path will be looked up and used as is.

def getOptional[A](path: String)(implicit evidence$1: ConfigLoader[A]): Option[A]

Get an optional configuration item.

Get an optional configuration item.

If the value of the item is null, this will return None, otherwise returns Some.

Throws
com.typesafe.config.ConfigException.Missing

if the value is undefined (as opposed to null) this will still throw an exception.

def getOptionalDeprecated[A](path: String, deprecated: String)(implicit evidence$2: ConfigLoader[A]): Option[A]

Get an optional deprecated configuration item.

Get an optional deprecated configuration item.

If the deprecated configuration item is defined, it will be returned, and a warning will be logged.

Otherwise, the configuration from path will be looked up.

If the value of the item is null, this will return None, otherwise returns Some.

def getPrototypedMap(path: String, prototypePath: String): Map[String, EnrichedConfig]

Get a prototyped map of objects.

Get a prototyped map of objects.

Each value in the map will fallback to the object loaded from prototype.$path.

def getPrototypedSeq(path: String, prototypePath: String): Seq[EnrichedConfig]

Get a prototyped sequence of objects.

Get a prototyped sequence of objects.

Each object in the sequence will fallback to the object loaded from prototype.$path.

def getSeq[A](path: String)(implicit loader: ConfigLoader[Seq[A]]): Seq[A]
def reportDeprecation(path: String, deprecated: String): Unit
def reportError(path: String, message: String, e: Option[Throwable]): Throwable

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!")
Value Params
e

the related exception

message

the error message

path

the configuration key, related to this error

Returns

a configuration exception

def subKeys: Set[String]

Get the immediate subkeys of this configuration.

Get the immediate subkeys of this configuration.

Concrete fields

val underlying: Config