final case classDiscriminated[X, D](codec: Codec[D]) extends Product with Serializable
Wrapper class that indicates subtypes of X are discriminated by type D
using the supplied Codec[D].
For example, an implicit Discriminated value can be defined in the companion
of a sealed trait, along with implicit Discriminator values in each subtype
companion. Given such implicits, a codec for the trait can be automatically
derived using Codec[X].
X
type that can be discriminated by discriminator values of type D
D
value type that discriminates Y in context of X from other types
using discriminators of D for some type Y
This member is added by an implicit conversion from Discriminated[X, D] to
any2stringadd[Discriminated[X, D]] performed by method any2stringadd in scala.Predef.
This member is added by an implicit conversion from Discriminated[X, D] to
ArrowAssoc[Discriminated[X, D]] performed by method ArrowAssoc in scala.Predef.
This member is added by an implicit conversion from Discriminated[X, D] to
StringFormat[Discriminated[X, D]] performed by method StringFormat in scala.Predef.
This member is added by an implicit conversion from Discriminated[X, D] to
ArrowAssoc[Discriminated[X, D]] performed by method ArrowAssoc in scala.Predef.
Wrapper class that indicates subtypes of
X
are discriminated by typeD
using the suppliedCodec[D]
.For example, an implicit
Discriminated
value can be defined in the companion of a sealed trait, along with implicitDiscriminator
values in each subtype companion. Given such implicits, a codec for the trait can be automatically derived usingCodec[X]
.type that can be discriminated by discriminator values of type
D
value type that discriminates
Y
in context ofX
from other types using discriminators ofD
for some typeY