All Downloads are FREE. Search and download functionalities are using the official Maven repository.

bson.BSONCodec.kt Maven / Gradle / Ivy

There is a newer version: 0.9.27
Show newest version
package com.github.fluidsonic.baku

import org.bson.BsonReader
import org.bson.BsonWriter
import org.bson.codecs.Codec
import org.bson.codecs.DecoderContext
import org.bson.codecs.EncoderContext
import kotlin.reflect.KClass


interface BSONCodec : BSONCodecProvider, Codec {

	override fun decode(reader: BsonReader, decoderContext: DecoderContext): Value
	override fun encode(writer: BsonWriter, value: Value, encoderContext: EncoderContext)


	@Suppress("UNCHECKED_CAST")
	override fun  codecForClass(valueClass: KClass) =
		if (encoderClass == valueClass.java)
			this as BSONCodec
		else
			null
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy