ConfigReader

pureconfig.ConfigReader
See theConfigReader companion object
trait ConfigReader[A]

Trait for objects capable of reading objects of a given type from ConfigValues.

Type parameters

A

the type of objects readable by this ConfigReader

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait EnumConfigReader[A]
trait ConfigConvert[A]

Members list

Value members

Abstract methods

def from(cur: ConfigCursor): Result[A]
Implicitly added by mapReader

Convert the configuration given by a cursor into an instance of A if possible.

Convert the configuration given by a cursor into an instance of A if possible.

Value parameters

cur

The cursor from which the config should be loaded

Attributes

Returns

either a list of failures or an object of type A

def from(cur: ConfigCursor): Result[A]
Implicitly added by optionReader

Convert the configuration given by a cursor into an instance of A if possible.

Convert the configuration given by a cursor into an instance of A if possible.

Value parameters

cur

The cursor from which the config should be loaded

Attributes

Returns

either a list of failures or an object of type A

def from(cur: ConfigCursor): Result[A]

Convert the configuration given by a cursor into an instance of A if possible.

Convert the configuration given by a cursor into an instance of A if possible.

Value parameters

cur

The cursor from which the config should be loaded

Attributes

Returns

either a list of failures or an object of type A

Concrete methods

def contramapConfig(f: ConfigValue => ConfigValue): ConfigReader[A]
Implicitly added by mapReader

Applies a function to configs before passing them to this reader.

Applies a function to configs before passing them to this reader.

Value parameters

f

the function to apply to input configs

Attributes

Returns

a ConfigReader returning the results of this reader when the input configs are mapped using f.

def contramapConfig(f: ConfigValue => ConfigValue): ConfigReader[A]
Implicitly added by optionReader

Applies a function to configs before passing them to this reader.

Applies a function to configs before passing them to this reader.

Value parameters

f

the function to apply to input configs

Attributes

Returns

a ConfigReader returning the results of this reader when the input configs are mapped using f.

def contramapConfig(f: ConfigValue => ConfigValue): ConfigReader[A]

Applies a function to configs before passing them to this reader.

Applies a function to configs before passing them to this reader.

Value parameters

f

the function to apply to input configs

Attributes

Returns

a ConfigReader returning the results of this reader when the input configs are mapped using f.

Implicitly added by mapReader

Applies a function to config cursors before passing them to this reader.

Applies a function to config cursors before passing them to this reader.

Value parameters

f

the function to apply to input config cursors

Attributes

Returns

a ConfigReader returning the results of this reader when the input cursors are mapped using f.

Implicitly added by optionReader

Applies a function to config cursors before passing them to this reader.

Applies a function to config cursors before passing them to this reader.

Value parameters

f

the function to apply to input config cursors

Attributes

Returns

a ConfigReader returning the results of this reader when the input cursors are mapped using f.

Applies a function to config cursors before passing them to this reader.

Applies a function to config cursors before passing them to this reader.

Value parameters

f

the function to apply to input config cursors

Attributes

Returns

a ConfigReader returning the results of this reader when the input cursors are mapped using f.

def emap[B](f: A => Either[FailureReason, B]): ConfigReader[B]
Implicitly added by mapReader

Maps a function that can possibly fail over the results of this reader.

Maps a function that can possibly fail over the results of this reader.

Type parameters

B

the value read by the function in case of success

Value parameters

f

the function to map over this reader

Attributes

Returns

a ConfigReader returning the results of this reader mapped by f, with the resulting Either flattened as a success or failure.

def emap[B](f: A => Either[FailureReason, B]): ConfigReader[B]
Implicitly added by optionReader

Maps a function that can possibly fail over the results of this reader.

Maps a function that can possibly fail over the results of this reader.

Type parameters

B

the value read by the function in case of success

Value parameters

f

the function to map over this reader

Attributes

Returns

a ConfigReader returning the results of this reader mapped by f, with the resulting Either flattened as a success or failure.

def emap[B](f: A => Either[FailureReason, B]): ConfigReader[B]

Maps a function that can possibly fail over the results of this reader.

Maps a function that can possibly fail over the results of this reader.

Type parameters

B

the value read by the function in case of success

Value parameters

f

the function to map over this reader

Attributes

Returns

a ConfigReader returning the results of this reader mapped by f, with the resulting Either flattened as a success or failure.

def ensure(pred: A => Boolean, message: A => String): ConfigReader[A]
Implicitly added by mapReader

Fails the reader if the condition does not hold for the result.

Fails the reader if the condition does not hold for the result.

Value parameters

message

the failed validation message

pred

the condition to assert

Attributes

Returns

a ConfigReader returning the results of this reader if the condition holds or a failed reader otherwise.

def ensure(pred: A => Boolean, message: A => String): ConfigReader[A]
Implicitly added by optionReader

Fails the reader if the condition does not hold for the result.

Fails the reader if the condition does not hold for the result.

Value parameters

message

the failed validation message

pred

the condition to assert

Attributes

Returns

a ConfigReader returning the results of this reader if the condition holds or a failed reader otherwise.

def ensure(pred: A => Boolean, message: A => String): ConfigReader[A]

Fails the reader if the condition does not hold for the result.

Fails the reader if the condition does not hold for the result.

Value parameters

message

the failed validation message

pred

the condition to assert

Attributes

Returns

a ConfigReader returning the results of this reader if the condition holds or a failed reader otherwise.

def flatMap[B](f: A => ConfigReader[B]): ConfigReader[B]
Implicitly added by mapReader

Monadically bind a function over the results of this reader.

Monadically bind a function over the results of this reader.

Type parameters

B

the type of the objects readable by the resulting ConfigReader

Value parameters

f

the function to bind over this reader

Attributes

Returns

a ConfigReader returning the results of this reader bound by f.

def flatMap[B](f: A => ConfigReader[B]): ConfigReader[B]
Implicitly added by optionReader

Monadically bind a function over the results of this reader.

Monadically bind a function over the results of this reader.

Type parameters

B

the type of the objects readable by the resulting ConfigReader

Value parameters

f

the function to bind over this reader

Attributes

Returns

a ConfigReader returning the results of this reader bound by f.

def flatMap[B](f: A => ConfigReader[B]): ConfigReader[B]

Monadically bind a function over the results of this reader.

Monadically bind a function over the results of this reader.

Type parameters

B

the type of the objects readable by the resulting ConfigReader

Value parameters

f

the function to bind over this reader

Attributes

Returns

a ConfigReader returning the results of this reader bound by f.

def from(config: ConfigValue): Result[A]
Implicitly added by mapReader

Convert the given configuration into an instance of A if possible.

Convert the given configuration into an instance of A if possible.

Value parameters

config

The configuration from which the config should be loaded

Attributes

Returns

either a list of failures or an object of type A

def from(config: ConfigValue): Result[A]
Implicitly added by optionReader

Convert the given configuration into an instance of A if possible.

Convert the given configuration into an instance of A if possible.

Value parameters

config

The configuration from which the config should be loaded

Attributes

Returns

either a list of failures or an object of type A

def from(config: ConfigValue): Result[A]

Convert the given configuration into an instance of A if possible.

Convert the given configuration into an instance of A if possible.

Value parameters

config

The configuration from which the config should be loaded

Attributes

Returns

either a list of failures or an object of type A

def map[B](f: A => B): ConfigReader[B]
Implicitly added by mapReader

Maps a function over the results of this reader.

Maps a function over the results of this reader.

Type parameters

B

the output type of the function

Value parameters

f

the function to map over this reader

Attributes

Returns

a ConfigReader returning the results of this reader mapped by f.

def map[B](f: A => B): ConfigReader[B]
Implicitly added by optionReader

Maps a function over the results of this reader.

Maps a function over the results of this reader.

Type parameters

B

the output type of the function

Value parameters

f

the function to map over this reader

Attributes

Returns

a ConfigReader returning the results of this reader mapped by f.

def map[B](f: A => B): ConfigReader[B]

Maps a function over the results of this reader.

Maps a function over the results of this reader.

Type parameters

B

the output type of the function

Value parameters

f

the function to map over this reader

Attributes

Returns

a ConfigReader returning the results of this reader mapped by f.

def orElse[AA >: A, B <: AA](reader: => ConfigReader[B]): ConfigReader[AA]
Implicitly added by mapReader

Combines this reader with another, returning the result of the first one that succeeds.

Combines this reader with another, returning the result of the first one that succeeds.

Type parameters

AA

the type of the objects readable by both readers

Value parameters

reader

the reader to combine with this one

Attributes

Returns

a ConfigReader returning the results of this reader if it succeeds and the results of reader otherwise.

def orElse[AA >: A, B <: AA](reader: => ConfigReader[B]): ConfigReader[AA]
Implicitly added by optionReader

Combines this reader with another, returning the result of the first one that succeeds.

Combines this reader with another, returning the result of the first one that succeeds.

Type parameters

AA

the type of the objects readable by both readers

Value parameters

reader

the reader to combine with this one

Attributes

Returns

a ConfigReader returning the results of this reader if it succeeds and the results of reader otherwise.

def orElse[AA >: A, B <: AA](reader: => ConfigReader[B]): ConfigReader[AA]

Combines this reader with another, returning the result of the first one that succeeds.

Combines this reader with another, returning the result of the first one that succeeds.

Type parameters

AA

the type of the objects readable by both readers

Value parameters

reader

the reader to combine with this one

Attributes

Returns

a ConfigReader returning the results of this reader if it succeeds and the results of reader otherwise.

def zip[B](reader: ConfigReader[B]): ConfigReader[(A, B)]
Implicitly added by mapReader

Combines this reader with another, returning both results as a pair.

Combines this reader with another, returning both results as a pair.

Type parameters

B

the type of the objects readable by the provided reader

Value parameters

reader

the reader to combine with this one

Attributes

Returns

a ConfigReader returning the results of both readers as a pair.

def zip[B](reader: ConfigReader[B]): ConfigReader[(A, B)]
Implicitly added by optionReader

Combines this reader with another, returning both results as a pair.

Combines this reader with another, returning both results as a pair.

Type parameters

B

the type of the objects readable by the provided reader

Value parameters

reader

the reader to combine with this one

Attributes

Returns

a ConfigReader returning the results of both readers as a pair.

def zip[B](reader: ConfigReader[B]): ConfigReader[(A, B)]

Combines this reader with another, returning both results as a pair.

Combines this reader with another, returning both results as a pair.

Type parameters

B

the type of the objects readable by the provided reader

Value parameters

reader

the reader to combine with this one

Attributes

Returns

a ConfigReader returning the results of both readers as a pair.