SerialFormat

interface SerialFormat

Represents an instance of a serialization format that can interact with KSerializer and is a supertype of all entry points for a serialization. It does not impose any restrictions on a serialized form or underlying storage, neither it exposes them.

Concrete data types and API for user-interaction are responsibility of a concrete subclass or subinterface, for example StringFormat, BinaryFormat or Json.

Typically, formats have their specific Encoder and Decoder implementations as private classes and do not expose them.

Not stable for inheritance

SerialFormat interface is not stable for inheritance in 3rd party libraries, as new methods might be added to this interface or contracts of the existing methods can be changed.

It is safe to operate with instances of SerialFormat and call its methods.

Properties

serializersModule
Link copied to clipboard
abstract val serializersModule: SerializersModule

Contains all serializers registered by format user for Contextual and Polymorphic serialization.

Inheritors

BinaryFormat
Link copied to clipboard
StringFormat
Link copied to clipboard