Class KotlinSerializationSupport<T extends kotlinx.serialization.SerialFormat>
java.lang.Object
org.springframework.http.codec.KotlinSerializationSupport<T>
- Type Parameters:
- T- the type of- SerialFormat
- Direct Known Subclasses:
- KotlinSerializationBinaryDecoder,- KotlinSerializationBinaryEncoder,- KotlinSerializationStringDecoder,- KotlinSerializationStringEncoder
public abstract class KotlinSerializationSupport<T extends kotlinx.serialization.SerialFormat>
extends Object
Base class providing support methods for encoding and decoding with Kotlin
 serialization.
 
As of Spring Framework 7.0, open polymorphism is supported.
- Since:
- 6.0
- Author:
- Sebastien Deleuze, Iain Henderson, Arjen Poutsma
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedKotlinSerializationSupport(T format, MimeType... supportedMimeTypes) Creates a new instance of this support class with the given format and supported mime types.
- 
Method SummaryModifier and TypeMethodDescriptionprotected final booleancanSerialize(ResolvableType type, @Nullable MimeType mimeType) Indicates whether the given type can be serialized using Kotlin serialization.protected final Tformat()Returns the format.serializer(ResolvableType resolvableType) Returns the serializer that can (de)serialize instances of the given type.Returns the supported mime types.
- 
Constructor Details- 
KotlinSerializationSupport
 
- 
- 
Method Details- 
formatReturns the format.
- 
supportedMimeTypes
- 
canSerializeIndicates whether the given type can be serialized using Kotlin serialization.- Parameters:
- type- the type to be serialized
- mimeType- the mimetype to use (can be- null)
- Returns:
- trueif- typecan be serialized; false otherwise
 
- 
serializerprotected final @Nullable kotlinx.serialization.KSerializer<Object> serializer(ResolvableType resolvableType) Returns the serializer that can (de)serialize instances of the given type. If no serializer can be found, or ifresolvableTypeis a open polymorphic type,nullis returned.- Parameters:
- resolvableType- the type to find a serializer for
- Returns:
- a resolved serializer for the given type, or null
 
 
-