CaseClassProductConfigReader

izumi.distage.config.codec.PureconfigInstances.configReaderDerivation.CaseClassProductConfigReader
final class CaseClassProductConfigReader[A](labels: Array[String], readTuple: (Array[ConfigCursor], Array[KeyNotFound]) => Either[ConfigReaderFailures, A]) extends ConfigReader[A]

Attributes

Graph
Supertypes
trait ConfigReader[A]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

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

Inherited methods

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.

Inherited from:
ConfigReader
def contramapCursor(f: ConfigCursor => ConfigCursor): ConfigReader[A]

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.

Inherited from:
ConfigReader
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.

Inherited from:
ConfigReader
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.

Inherited from:
ConfigReader
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.

Inherited from:
ConfigReader
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

Inherited from:
ConfigReader
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.

Inherited from:
ConfigReader
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.

Inherited from:
ConfigReader
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.

Inherited from:
ConfigReader