A Decoder is used to convert an Avro value, such as a GenericRecord,
SpecificRecord, GenericFixed, EnumSymbol, or a basic JVM type, into a
target Scala type.
For example, a Decoder[String] would convert an input of type Utf8 -
which is one of the ways Avro can encode strings - into a plain Java String.
Another example, a decoder for Option[String] would handle inputs of null
by emitting a None, and a non-null input by wrapping the decoded value
in a Some.
A final example is converting a GenericData.Array or a Java collection type
into a Scala collection type.
A Decoder is used to convert an Avro value, such as a GenericRecord, SpecificRecord, GenericFixed, EnumSymbol, or a basic JVM type, into a target Scala type.
For example, a Decoder[String] would convert an input of type Utf8 - which is one of the ways Avro can encode strings - into a plain Java String.
Another example, a decoder for Option[String] would handle inputs of null by emitting a None, and a non-null input by wrapping the decoded value in a Some.
A final example is converting a GenericData.Array or a Java collection type into a Scala collection type.