object GenericSerializer
Functional composable Kafka key- and record serializer with support for effect types.
- Source
- Serializer.scala
- Alphabetic
- By Inheritance
- GenericSerializer
- 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
- def apply[F[_]](implicit F: Sync[F]): Serializer[F, Array[Byte]]
Alias for Serializer#identity.
- def apply[F[_], A](implicit serializer: Serializer[F, A]): Serializer[F, A]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asNull[F[_], A](implicit F: Sync[F]): Serializer[F, A]
Creates a new Serializer which serializes all values of type
A
asnull
. - def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def const[F[_], A](bytes: Array[Byte])(implicit F: Sync[F]): Serializer[F, A]
Creates a new Serializer which serializes all values of type
A
to the specifiedbytes
. - implicit def contravariant[T <: KeyOrValue, F[_]]: Contravariant[[γ$0$]GenericSerializer[T, F, γ$0$]]
- def delegate[F[_], A](serializer: KafkaSerializer[A])(implicit F: Sync[F]): Serializer[F, A]
Creates a new Serializer which delegates serialization to the specified Kafka
Serializer
.Creates a new Serializer which delegates serialization to the specified Kafka
Serializer
. Note theclose
andconfigure
functions won't be called for the delegate.It is assumed the delegate
serialize
function is pure. If it's not pure, then usesuspend
afterdelegate
, so the impure behaviours can be captured properly. - implicit def double[F[_]](implicit F: Sync[F]): Serializer[F, Double]
- def empty[F[_], A](implicit F: Sync[F]): Serializer[F, A]
Creates a new Serializer which serializes all values of type
A
as the emptyArray[Byte]
. - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def fail[F[_], A](e: Throwable)(implicit F: Sync[F]): Serializer[F, A]
Creates a new Serializer which always fails serialization with the specified exception
e
. - def failWith[F[_], A](message: String)(implicit F: Sync[F]): Serializer[F, A]
Creates a new Serializer which always fails serialization with a SerializationException using the specified message.
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- implicit def float[F[_]](implicit F: Sync[F]): Serializer[F, Float]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def headers[F[_], A](f: (Headers) => Serializer[F, A])(implicit F: Sync[F]): Serializer[F, A]
Creates a new Serializer which can use different Serializers depending on the record headers.
- implicit def identity[F[_]](implicit F: Sync[F]): Serializer[F, Array[Byte]]
The identity Serializer, which does not perform any kind of serialization, simply using the input bytes as the output.
- def instance[F[_], A](f: (String, Headers, A) => F[Array[Byte]])(implicit F: Sync[F]): Serializer[F, A]
Creates a new Serializer from the specified function.
Creates a new Serializer from the specified function. Use lift instead if the serializer doesn't need access to the Kafka topic name or record headers.
- implicit def int[F[_]](implicit F: Sync[F]): Serializer[F, Int]
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def lift[F[_], A](f: (A) => F[Array[Byte]])(implicit F: Sync[F]): Serializer[F, A]
Creates a new Serializer from the specified function, ignoring to which Kafka topic the bytes are going to be sent and any record headers.
Creates a new Serializer from the specified function, ignoring to which Kafka topic the bytes are going to be sent and any record headers. Use instance instead if the serializer needs access to the Kafka topic name or the record headers.
- implicit def long[F[_]](implicit F: Sync[F]): Serializer[F, Long]
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- implicit def option[T <: KeyOrValue, F[_], A](implicit serializer: GenericSerializer[T, F, A]): GenericSerializer[T, F, Option[A]]
The option Serializer serializes
None
asnull
, and serializesSome
values using the serializer for typeA
. - implicit def resource[T <: KeyOrValue, F[_], A](implicit ser: GenericSerializer[T, F, A]): Resource[F, GenericSerializer[T, F, A]]
- implicit def short[F[_]](implicit F: Sync[F]): Serializer[F, Short]
- implicit def string[F[_]](implicit F: Sync[F]): Serializer[F, String]
- def string[F[_]](charset: Charset)(implicit F: Sync[F]): Serializer[F, String]
Creates a new Serializer which serializes
String
values using the specifiedCharset
.Creates a new Serializer which serializes
String
values using the specifiedCharset
. Note that the defaultString
serializer usesUTF-8
. - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def topic[T <: KeyOrValue, F[_], A](f: PartialFunction[String, GenericSerializer[T, F, A]])(implicit F: Sync[F]): GenericSerializer[T, F, A]
Creates a new Serializer which can use different Serializers depending on the Kafka topic name to which the bytes are going to be sent.
- implicit def unit[F[_]](implicit F: Sync[F]): Serializer[F, Unit]
- implicit def uuid[F[_]](implicit F: Sync[F]): Serializer[F, UUID]
- def uuid[F[_]](charset: Charset)(implicit F: Sync[F]): Serializer[F, UUID]
Creates a new Serializer which serializes
UUID
values asString
s with the specifiedCharset
.Creates a new Serializer which serializes
UUID
values asString
s with the specifiedCharset
. Note that the defaultUUID
serializer usesUTF-8.
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- 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()