Class KotlinSerializationBinaryEncoder<T extends kotlinx.serialization.BinaryFormat>

java.lang.Object
org.springframework.http.codec.KotlinSerializationSupport<T>
org.springframework.http.codec.KotlinSerializationBinaryEncoder<T>
Type Parameters:
T - the type of BinaryFormat
All Implemented Interfaces:
org.springframework.core.codec.Encoder<Object>
Direct Known Subclasses:
KotlinSerializationCborEncoder, KotlinSerializationProtobufEncoder

public abstract class KotlinSerializationBinaryEncoder<T extends kotlinx.serialization.BinaryFormat> extends KotlinSerializationSupport<T> implements org.springframework.core.codec.Encoder<Object>
Abstract base class for Encoder implementations that defer to Kotlin binary serializers.
Since:
6.0
Author:
Sebastien Deleuze, Iain Henderson, Arjen Poutsma
  • Constructor Details

    • KotlinSerializationBinaryEncoder

      protected KotlinSerializationBinaryEncoder(T format, org.springframework.util.MimeType... supportedMimeTypes)
  • Method Details

    • canEncode

      public boolean canEncode(org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType)
      Specified by:
      canEncode in interface org.springframework.core.codec.Encoder<T extends kotlinx.serialization.BinaryFormat>
    • getEncodableMimeTypes

      public List<org.springframework.util.MimeType> getEncodableMimeTypes()
      Specified by:
      getEncodableMimeTypes in interface org.springframework.core.codec.Encoder<T extends kotlinx.serialization.BinaryFormat>
    • getEncodableMimeTypes

      public List<org.springframework.util.MimeType> getEncodableMimeTypes(org.springframework.core.ResolvableType elementType)
      Specified by:
      getEncodableMimeTypes in interface org.springframework.core.codec.Encoder<T extends kotlinx.serialization.BinaryFormat>
    • encode

      public reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer> encode(Publisher<?> inputStream, org.springframework.core.io.buffer.DataBufferFactory bufferFactory, org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType, @Nullable Map<String,Object> hints)
      Specified by:
      encode in interface org.springframework.core.codec.Encoder<T extends kotlinx.serialization.BinaryFormat>
    • encodeValue

      public org.springframework.core.io.buffer.DataBuffer encodeValue(Object value, org.springframework.core.io.buffer.DataBufferFactory bufferFactory, org.springframework.core.ResolvableType valueType, @Nullable org.springframework.util.MimeType mimeType, @Nullable Map<String,Object> hints)
      Specified by:
      encodeValue in interface org.springframework.core.codec.Encoder<T extends kotlinx.serialization.BinaryFormat>