create

inline fun <T : Any> create(serializersModule: SerializersModule = defaultSerializersModule, bsonConfiguration: BsonConfiguration = BsonConfiguration()): Codec<T>?

Creates a Codec<T> for the kClass or returns null if there is no serializer available.

Return

the codec

Parameters

T

The codec type

serializersModule

the serializiers module to use

bsonConfiguration

the bson configuration for serializing


fun <T : Any> create(kClass: KClass<T>, serializersModule: SerializersModule = defaultSerializersModule, bsonConfiguration: BsonConfiguration = BsonConfiguration()): Codec<T>?

Creates a Codec<T> for the kClass or returns null if there is no serializer available.

Return

the codec

Parameters

T

The codec type

kClass

the KClass for the codec

serializersModule

the serializiers module to use

bsonConfiguration

the bson configuration for serializing


fun <T : Any> create(kClass: KClass<T>, serializer: KSerializer<T>, serializersModule: SerializersModule, bsonConfiguration: BsonConfiguration): Codec<T>

Creates a Codec<T> for the kClass using the supplied serializer

Return

the codec

Parameters

T

The codec type

kClass

the KClass for the codec

serializer

the KSerializer to use

serializersModule

the serializiers module to use

bsonConfiguration

the bson configuration for serializing