model.PhoneNumberBSONCodec.kt Maven / Gradle / Ivy
package com.github.fluidsonic.baku
import org.bson.BsonReader
import org.bson.BsonWriter
internal object PhoneNumberBSONCodec : AbstractBSONCodec() {
override fun BsonReader.decode(context: BSONCodingContext) =
PhoneNumber(readString())
override fun BsonWriter.encode(value: PhoneNumber, context: BSONCodingContext) {
writeString(value.raw)
}
}