ConfigObjectSource

pureconfig.ConfigObjectSource
See theConfigObjectSource companion object
final class ConfigObjectSource extends ConfigSource

A ConfigSource which is guaranteed to generate config objects (maps) as root values.

Value parameters

getConf

the thunk to generate a Config instance. This parameter won't be memoized so it can be used with dynamic sources (e.g. URLs)

Attributes

Companion
object
Graph
Supertypes
trait ConfigSource
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def config(): Result[Config]

Reads a Config from this config source. The returned config is usually unresolved, unless the source forces it otherwise.

Reads a Config from this config source. The returned config is usually unresolved, unless the source forces it otherwise.

Attributes

Returns

a Config provided by this source.

override def cursor(): Result[ConfigCursor]

Returns a cursor for a ConfigValue retrieved from this source.

Returns a cursor for a ConfigValue retrieved from this source.

Attributes

Returns

a cursor for a ConfigValue retrieved from this source.

Definition Classes

Returns a ConfigObjectSource that provides the same config as this one, but falls back to providing an empty config when the source cannot be read. It can be used together with .withFallback to specify optional config files to be merged (like reference.conf).

Returns a ConfigObjectSource that provides the same config as this one, but falls back to providing an empty config when the source cannot be read. It can be used together with .withFallback to specify optional config files to be merged (like reference.conf).

Attributes

Returns

a new ConfigObjectSource that provides the same config as this one, but falls back to an empty config if it cannot be read.

Applies a function f if this source returns a failure, returning an alternative config source in those cases.

Applies a function f if this source returns a failure, returning an alternative config source in those cases.

Value parameters

f

the function to apply if this source returns a failure

Attributes

Returns

a new ConfigObjectSource that provides an alternative config in case this source fails

def value(): Result[ConfigObject]

Retrieves a ConfigValue from this source. This forces the config to be resolved, if needed.

Retrieves a ConfigValue from this source. This forces the config to be resolved, if needed.

Attributes

Returns

a ConfigValue retrieved from this source.

Merges this source with another one, with the latter being used as a fallback (e.g. the source on which this method is called takes priority). Both sources are required to produce a config object successfully.

Merges this source with another one, with the latter being used as a fallback (e.g. the source on which this method is called takes priority). Both sources are required to produce a config object successfully.

Value parameters

cs

the config source to use as fallback

Attributes

Returns

a new ConfigObjectSource that loads configs from both sources and uses cs as a fallback for this source

Inherited methods

def at(namespace: String): ConfigSource

Navigates through the config to focus on a namespace.

Navigates through the config to focus on a namespace.

Value parameters

namespace

the namespace to focus on

Attributes

Returns

a new ConfigSource focused on the given namespace.

Inherited from:
ConfigSource

Returns a fluent cursor for a ConfigValue retrieved from this source.

Returns a fluent cursor for a ConfigValue retrieved from this source.

Attributes

Returns

a fluent cursor for a ConfigValue retrieved from this source.

Inherited from:
ConfigSource
final def load[A](implicit reader: ConfigReader[A]): Result[A]

Loads a configuration of type A from this source.

Loads a configuration of type A from this source.

Type parameters

A

the type of the config to be loaded

Attributes

Returns

A Right with the configuration if it is possible to create an instance of type A from this source, a Failure with details on why it isn't possible otherwise

Inherited from:
ConfigSource
final def loadOrThrow[A : ClassTag](implicit evidence$1: ClassTag[A], reader: ConfigReader[A]): A

Loads a configuration of type A from this source. If it is not possible to create an instance of A, this method throws a ConfigReaderException.

Loads a configuration of type A from this source. If it is not possible to create an instance of A, this method throws a ConfigReaderException.

Type parameters

A

the type of the config to be loaded

Attributes

Returns

The configuration of type A loaded from this source.

Inherited from:
ConfigSource