HeaderSerializer

Companion
class
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply[A](serializer: HeaderSerializer[A]): HeaderSerializer[A]

Creates a new HeaderSerializer which serializes all values of type A as null.

Creates a new HeaderSerializer which serializes all values of type A as null.

def const[A](bytes: Array[Byte]): HeaderSerializer[A]

Creates a new HeaderSerializer which serializes all values of type A to the specified bytes.

Creates a new HeaderSerializer which serializes all values of type A to the specified bytes.

def delegate[A](serializer: Serializer[A]): HeaderSerializer[A]

Creates a new HeaderSerializer which delegates serialization to the specified Kafka Serializer. Note that the close and configure functions won't be called for the delegate. Also, the topic is an empty String and no headers are provided.

Creates a new HeaderSerializer which delegates serialization to the specified Kafka Serializer. Note that the close and configure functions won't be called for the delegate. Also, the topic is an empty String and no headers are provided.

Creates a new HeaderSerializer which serializes all values of type A as the empty Array[Byte].

Creates a new HeaderSerializer which serializes all values of type A as the empty Array[Byte].

def instance[A](f: A => Array[Byte]): HeaderSerializer[A]

Creates a new HeaderSerializer from the specified function.

Creates a new HeaderSerializer from the specified function.

def string(charset: Charset): HeaderSerializer[String]

Creates a new HeaderSerializer which serializes String values using the specified Charset. Note that the default String serializer uses UTF-8.

Creates a new HeaderSerializer which serializes String values using the specified Charset. Note that the default String serializer uses UTF-8.

def uuid(charset: Charset): HeaderSerializer[UUID]

Creates a new HeaderSerializer which serializes UUID values as Strings with the specified Charset. Note that the default UUID serializer uses UTF-8.

Creates a new HeaderSerializer which serializes UUID values as Strings with the specified Charset. Note that the default UUID serializer uses UTF-8.

Implicits

Implicits

implicit val contravariant: Contravariant[[A] =>> HeaderSerializer[A]]
implicit val double: HeaderSerializer[Double]
implicit val float: HeaderSerializer[Float]
implicit val identity: HeaderSerializer[Array[Byte]]

The identity HeaderSerializer, which does not perform serialization, simply using the input bytes as the output.

The identity HeaderSerializer, which does not perform serialization, simply using the input bytes as the output.

implicit val int: HeaderSerializer[Int]
implicit val long: HeaderSerializer[Long]
implicit def option[A](serializer: HeaderSerializer[A]): HeaderSerializer[Option[A]]

The option HeaderSerializer serializes None as null, and serializes Some values using the serializer for type A.

The option HeaderSerializer serializes None as null, and serializes Some values using the serializer for type A.

implicit val short: HeaderSerializer[Short]
implicit val string: HeaderSerializer[String]
implicit val unit: HeaderSerializer[Unit]
implicit val uuid: HeaderSerializer[UUID]