object CompactMapBasedCodecs
Same as MapBasedCodecs, but with "compact", i.e. unwrapped, encodings for unary case classes.
- Alphabetic
- By Inheritance
- CompactMapBasedCodecs
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
macro
def
deriveAllCodecs[T]: Codec[T]
Macro that creates an Encoder and Decoder pair for T and all direct and indirect sub-types of 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])". -
macro
def
deriveAllDecoders[T]: Decoder[T]
Macro that creates a Decoder for T and all direct and indirect sub-types of T, which are concrete, i.e.
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 a
sealed abstract classorsealed 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 <: Tis 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 <: Tis already implicitly available at the macro call-site the respective lines for **all** sub-types ofSare **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.
-
macro
def
deriveAllEncoders[T]: Encoder[T]
Macro that creates an Encoder for T and all direct and indirect sub-types of T, which are concrete, i.e.
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 a
sealed abstract classorsealed 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 <: Tis 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 <: Tis already implicitly available at the macro call-site the respective lines for **all** sub-types ofSare **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.
-
macro
def
deriveCodec[T]: Codec[T]
Macro that creates an Encoder and Decoder pair for T.
Macro that creates an Encoder and Decoder pair for T. Convenience shortcut for
Codec(deriveEncoder[T], deriveDecoder[T])". -
macro
def
deriveDecoder[T]: Decoder[T]
Macro that creates a Decoder for T provided that - T is a
case class,sealed abstract classorsealed trait- Decoder instances for all members of T (if T is acase class) or all sub-types of T (if T is an ADT) are implicitly availableMacro that creates a Decoder for T provided that - T is a
case class,sealed abstract classorsealed trait- Decoder instances for all members of T (if T is acase class) or all sub-types of T (if T is an ADT) are implicitly availableCase classes are created from a map of values, one key-value pair for each member. The key for each member is a
Stringholding the member's name. This can be customized with the key annotation.NOTE: If
Tis unary (i.e. only has a single member) then the member value is expected in an unwrapped form, * i.e. without the map container. -
macro
def
deriveEncoder[T]: Encoder[T]
Macro that creates an Encoder for T provided that - T is a
case class,sealed abstract classorsealed trait- Encoder instances for all members of T (if T is acase class) or all sub-types of T (if T is an ADT) are implicitly availableMacro that creates an Encoder for T provided that - T is a
case class,sealed abstract classorsealed trait- Encoder instances for all members of T (if T is acase class) or all sub-types of T (if T is an ADT) are implicitly availableCase classes are converted into a map of values, one key-value pair for each member. The key for each member is a
Stringholding the member's name. This can be customized with the key annotation.NOTE: If
Tis unary (i.e. only has a single member) then the member value is written in an unwrapped form, * i.e. without the map container. -
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()