Deserializer

Companion
class
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply[F[_], A](implicit deserializer: Deserializer[F, A]): Deserializer[F, A]
def apply[F[_]](implicit F: Sync[F]): Deserializer[F, Array[Byte]]
def const[F[_], A](a: A)(implicit F: Sync[F]): Deserializer[F, A]

Creates a new Deserializer which deserializes all bytes to the specified value of type A.

Creates a new Deserializer which deserializes all bytes to the specified value of type A.

def delegate[F[_], A](deserializer: Deserializer[A])(implicit F: Sync[F]): Deserializer[F, A]

Creates a new Deserializer which delegates deserialization to the specified Kafka Deserializer. Note that the close and configure functions won't be called for the delegate.

It is assumed the delegate deserialize function is pure. If it's not pure, then use suspend after delegate, so the impure behaviours can be captured properly.

Creates a new Deserializer which delegates deserialization to the specified Kafka Deserializer. Note that the close and configure functions won't be called for the delegate.

It is assumed the delegate deserialize function is pure. If it's not pure, then use suspend after delegate, so the impure behaviours can be captured properly.

def fail[F[_], A](e: Throwable)(implicit F: Sync[F]): Deserializer[F, A]

Creates a new Deserializer which always fails deserialization with the specified exception e.

Creates a new Deserializer which always fails deserialization with the specified exception e.

def failWith[F[_], A](message: String)(implicit F: Sync[F]): Deserializer[F, A]

Creates a new Deserializer which always fails deserialization with a DeserializationException using the specified message.

Creates a new Deserializer which always fails deserialization with a DeserializationException using the specified message.

def headers[F[_], A](f: Headers => Deserializer[F, A])(implicit F: Sync[F]): Deserializer[F, A]

Creates a new Deserializer which can use different Deserializers depending on the record headers.

Creates a new Deserializer which can use different Deserializers depending on the record headers.

def instance[F[_], A](f: (String, Headers, Array[Byte]) => F[A])(implicit F: Sync[F]): Deserializer[F, A]

Creates a new Deserializer from the specified function. Use lift instead if the deserializer doesn't need access to the Kafka topic name or record headers.

Creates a new Deserializer from the specified function. Use lift instead if the deserializer doesn't need access to the Kafka topic name or record headers.

def lift[F[_], A](f: Array[Byte] => F[A])(implicit F: Sync[F]): Deserializer[F, A]

Creates a new Deserializer from the specified function, ignoring from which Kafka topic the bytes came and any record headers. Use instance instead if the deserializer needs access to the Kafka topic name or the record headers.

Creates a new Deserializer from the specified function, ignoring from which Kafka topic the bytes came and any record headers. Use instance instead if the deserializer needs access to the Kafka topic name or the record headers.

def string[F[_]](charset: Charset)(implicit F: Sync[F]): Deserializer[F, String]

Creates a new Deserializer which deserializes String values using the specified Charset. Note that the default String deserializer uses UTF-8.

Creates a new Deserializer which deserializes String values using the specified Charset. Note that the default String deserializer uses UTF-8.

def topic[F[_], A](f: PartialFunction[String, Deserializer[F, A]])(implicit F: Sync[F]): Deserializer[F, A]

Creates a new Deserializer which can use different Deserializers depending on the Kafka topic name from which the serialized bytes came.

Creates a new Deserializer which can use different Deserializers depending on the Kafka topic name from which the serialized bytes came.

def uuid[F[_]](charset: Charset)(implicit F: Sync[F]): Deserializer[F, UUID]

Creates a new Deserializer which deserializes String values using the specified Charset as UUIDs. Note that the default UUID deserializer uses UTF-8.

Creates a new Deserializer which deserializes String values using the specified Charset as UUIDs. Note that the default UUID deserializer uses UTF-8.

Implicits

Implicits

implicit
def double[F[_]](implicit F: Sync[F]): Deserializer[F, Double]
implicit
def float[F[_]](implicit F: Sync[F]): Deserializer[F, Float]
implicit
def identity[F[_]](implicit F: Sync[F]): Deserializer[F, Array[Byte]]

The identity Deserializer, which does not perform any kind of deserialization, simply using the input bytes as the output.

The identity Deserializer, which does not perform any kind of deserialization, simply using the input bytes as the output.

implicit
def int[F[_]](implicit F: Sync[F]): Deserializer[F, Int]
implicit
def long[F[_]](implicit F: Sync[F]): Deserializer[F, Long]
implicit
def monadError[F[_]](implicit F: Sync[F]): MonadError[[_] =>> Deserializer[F, _$22], Throwable]
implicit
def option[F[_], A](implicit deserializer: Deserializer[F, A]): Deserializer[F, Option[A]]

The option Deserializer returns None when the bytes are null, and otherwise deserializes using the deserializer for the type A, wrapping the result in Some.

The option Deserializer returns None when the bytes are null, and otherwise deserializes using the deserializer for the type A, wrapping the result in Some.

implicit
def short[F[_]](implicit F: Sync[F]): Deserializer[F, Short]
implicit
def string[F[_]](implicit F: Sync[F]): Deserializer[F, String]
implicit
def unit[F[_]](implicit F: Sync[F]): Deserializer[F, Unit]
implicit
def uuid[F[_]](implicit F: Sync[F]): Deserializer[F, UUID]