object ArrayBasedCodecs
Derivation macros for array-based encodings.
- Alphabetic
- By Inheritance
- ArrayBasedCodecs
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
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(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- 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 an array of deserialized values, one value for each member.
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 array 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 an array of values, one value for each member.
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 array container. - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- 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() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated