Decoder

io.github.srs.config.yaml.parser.Decoder
See theDecoder companion trait
object Decoder

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Decoder.type

Members list

Type members

Classlikes

object given_Decoder_Boolean extends Decoder[Boolean]

Attributes

Supertypes
trait Decoder[Boolean]
class Object
trait Matchable
class Any
Self type
object given_Decoder_Double extends Decoder[Double]

Attributes

Supertypes
trait Decoder[Double]
class Object
trait Matchable
class Any
Self type
object given_Decoder_Int extends Decoder[Int]

Attributes

Supertypes
trait Decoder[Int]
class Object
trait Matchable
class Any
Self type
object given_Decoder_Long extends Decoder[Long]

Attributes

Supertypes
trait Decoder[Long]
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
trait Decoder[Policy]
class Object
trait Matchable
class Any
Self type
object given_Decoder_String extends Decoder[String]

Attributes

Supertypes
trait Decoder[String]
class Object
trait Matchable
class Any
Self type
object given_Decoder_UUID extends Decoder[UUID]

Attributes

Supertypes
trait Decoder[UUID]
class Object
trait Matchable
class Any
Self type

Value members

Concrete methods

def get[A](field: String, map: Map[String, Any])(using decoder: Decoder[A]): ConfigResult[A]

Retrieves a value from a map using the specified field name and decodes it using the provided decoder. If the field is not present in the map, it returns a ConfigError indicating the missing field.

Retrieves a value from a map using the specified field name and decodes it using the provided decoder. If the field is not present in the map, it returns a ConfigError indicating the missing field.

Type parameters

A

the type of value to decode

Value parameters

decoder

the decoder to use for decoding the value

field

the name of the field to retrieve

map

the map containing configuration values

Attributes

Returns

a ConfigResult containing either the decoded value or a sequence of configuration errors

def getOptional[A](field: String, map: Map[String, Any])(using decoder: Decoder[A]): ConfigResult[Option[A]]

Retrieves an optional value from a map using the specified field name and decodes it using the provided decoder. If the field is not present in the map, it returns None.

Retrieves an optional value from a map using the specified field name and decodes it using the provided decoder. If the field is not present in the map, it returns None.

Type parameters

A

the type of value to decode

Value parameters

decoder

decoder to use for decoding the value

field

the name of the field to retrieve

map

the map containing configuration values

Attributes

Returns

a ConfigResult containing either the decoded value wrapped in Some, or None if the field is not present