Search in sources :

Example 1 with Decimal128Codec

use of org.bson.codecs.Decimal128Codec in project immutables by immutables.

the class BsonModule method defaultRegistry.

private static CodecRegistry defaultRegistry() {
    CodecRegistry standard = CodecRegistries.fromProviders(new BsonValueCodecProvider(), new Jsr310CodecProvider());
    // avoid codecs for String / Long / Boolean etc. They're already handled by jackson
    // choose the ones which need to be natively serialized in non-JSON format (BSON)
    CodecRegistry others = CodecRegistries.fromCodecs(new ObjectIdCodec(), new DateCodec(), new UuidCodec(UuidRepresentation.JAVA_LEGACY), new Decimal128Codec(), new PatternCodec(), new BigDecimalCodec(), new ByteArrayCodec());
    return CodecRegistries.fromRegistries(standard, others);
}
Also used : ByteArrayCodec(org.bson.codecs.ByteArrayCodec) UuidCodec(org.bson.codecs.UuidCodec) Jsr310CodecProvider(org.bson.codecs.jsr310.Jsr310CodecProvider) ObjectIdCodec(org.bson.codecs.ObjectIdCodec) DateCodec(org.bson.codecs.DateCodec) Decimal128Codec(org.bson.codecs.Decimal128Codec) BigDecimalCodec(org.bson.codecs.BigDecimalCodec) CodecRegistry(org.bson.codecs.configuration.CodecRegistry) PatternCodec(org.bson.codecs.PatternCodec) BsonValueCodecProvider(org.bson.codecs.BsonValueCodecProvider)

Aggregations

BigDecimalCodec (org.bson.codecs.BigDecimalCodec)1 BsonValueCodecProvider (org.bson.codecs.BsonValueCodecProvider)1 ByteArrayCodec (org.bson.codecs.ByteArrayCodec)1 DateCodec (org.bson.codecs.DateCodec)1 Decimal128Codec (org.bson.codecs.Decimal128Codec)1 ObjectIdCodec (org.bson.codecs.ObjectIdCodec)1 PatternCodec (org.bson.codecs.PatternCodec)1 UuidCodec (org.bson.codecs.UuidCodec)1 CodecRegistry (org.bson.codecs.configuration.CodecRegistry)1 Jsr310CodecProvider (org.bson.codecs.jsr310.Jsr310CodecProvider)1