Class BsonTypeCodecMap


  • public class BsonTypeCodecMap
    extends java.lang.Object
    An efficient map of BsonType to Codec
    Since:
    3.3
    • Constructor Summary

      Constructors 
      Constructor Description
      BsonTypeCodecMap​(BsonTypeClassMap bsonTypeClassMap, CodecRegistry codecRegistry)
      Initializes the map by iterating the keys of the given BsonTypeClassMap and looking up the Codec for the Class mapped to each key.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Codec<?> get​(BsonType bsonType)
      Gets the Codec mapped to the given bson type.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BsonTypeCodecMap

        public BsonTypeCodecMap​(BsonTypeClassMap bsonTypeClassMap,
                                CodecRegistry codecRegistry)
        Initializes the map by iterating the keys of the given BsonTypeClassMap and looking up the Codec for the Class mapped to each key.
        Parameters:
        bsonTypeClassMap - the non-null BsonTypeClassMap
        codecRegistry - the non-null CodecRegistry
    • Method Detail

      • get

        public Codec<?> get​(BsonType bsonType)
        Gets the Codec mapped to the given bson type.
        Parameters:
        bsonType - the non-null BsonType
        Returns:
        the non-null Codec