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
serializers Module
the serializiers module to use
bson Configuration
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
k Class
the KClass for the codec
serializers Module
the serializiers module to use
bson Configuration
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
k Class
the KClass for the codec
serializer
the KSerializer to use
serializers Module
the serializiers module to use
bson Configuration
the bson configuration for serializing