MapBasedCodecs
Members list
Type members
Classlikes
Attributes
- Graph
- Supertypes
Attributes
- Graph
- Supertypes
Value members
Concrete methods
Macro that creates an Encoder and Decoder pair for T and all direct and indirect sub-types of T.
Convenience shortcut for Codec(deriveAllEncoders[T], deriveAllDecoders[T])
.
Macro that creates an Encoder and Decoder pair for T and all direct and indirect sub-types of T.
Convenience shortcut for Codec(deriveAllEncoders[T], deriveAllDecoders[T])
.
Attributes
Macro that creates a Decoder for T and all direct and indirect sub-types of T,
which are concrete, i.e. not abstract.
T must be an enum
, sealed abstract class
or sealed trait
.
Macro that creates a Decoder for T and all direct and indirect sub-types of T,
which are concrete, i.e. not abstract.
T must be an enum
, sealed abstract class
or sealed trait
.
It works by generating a code block such as this one:
implicit val a = deriveDecoder[A] // one such line is generated for each concrete
implicit val b = deriveDecoder[B] // direct or indirect sub-type of T which doesn't
implicit val c = deriveDecoder[C] // already have an implicit Decoder available
...
deriveDecoder[T]
If a Decoder for a certain concrete sub-type S <: T
is already implicitly available
at the macro call-site the respective line for the sub-type is not generated.
If a Decoder for a certain abstract sub-type S <: T
is already implicitly available
at the macro call-site the respective lines for all sub-types of S
are not generated.
This means that you can specify your own custom Decoders for concrete sub-types or whole branches of the sub-type hierarchy and they will be properly picked up rather than create conflicts.
Attributes
Macro that creates an Encoder for T and all direct and indirect sub-types of T,
which are concrete, i.e. not abstract.
T must be an enum
, sealed abstract class
or sealed trait
.
Macro that creates an Encoder for T and all direct and indirect sub-types of T,
which are concrete, i.e. not abstract.
T must be an enum
, sealed abstract class
or sealed trait
.
It works by generating a code block such as this one:
implicit val a = deriveEncoder[A] // one such line is generated for each concrete
implicit val b = deriveEncoder[B] // direct or indirect sub-type of T which doesn't
implicit val c = deriveEncoder[C] // already have an implicit Encoder available
...
deriveEncoder[T]
If an Encoder for a certain concrete sub-type S <: T
is already implicitly available
at the macro call-site the respective line for the sub-type is not generated.
If an Encoder for a certain abstract sub-type S <: T
is already implicitly available
at the macro call-site the respective lines for all sub-types of S
are not generated.
This means that you can specify your own custom Encoders for concrete sub-types or whole branches of the sub-type hierarchy and they will be properly picked up rather than create conflicts.
Attributes
Macro that creates an Encoder and Decoder pair for T.
Convenience shortcut for Codec(deriveEncoder[T], deriveDecoder[T])
.
Macro that creates an Encoder and Decoder pair for T.
Convenience shortcut for Codec(deriveEncoder[T], deriveDecoder[T])
.
Attributes
Macro that creates a Decoder for T provided that
Macro that creates a Decoder for T provided that
- T is a
case class
,enum
,sealed abstract class
orsealed trait
- Decoder instances for all members of T (if T is a
case class
) or all sub-types of T (if T is an ADT) are implicitly available
Case classes are created from a map of values, one key-value pair for each member.
The key for each member is a String
holding the member's name.
This can be customized with the key annotation.
Attributes
Macro that creates an Encoder for T provided that
Macro that creates an Encoder for T provided that
- T is a
case class
,enum
,sealed abstract class
orsealed trait
- Encoder instances for all members of T (if T is a
case class
) or all sub-types of T (if T is an ADT) are implicitly available
Case classes are converted into a map of values, one key-value pair for each member.
The key for each member is a String
holding the member's name.
This can be customized with the key annotation.