public class MapCodec extends java.lang.Object implements Codec<java.util.Map<java.lang.String,java.lang.Object>>
Constructor and Description |
---|
MapCodec()
Construct a new instance with a default
CodecRegistry |
MapCodec(CodecRegistry registry)
Construct a new instance with the given registry
|
MapCodec(CodecRegistry registry,
BsonTypeClassMap bsonTypeClassMap)
Construct a new instance with the given registry and BSON type class map.
|
MapCodec(CodecRegistry registry,
BsonTypeClassMap bsonTypeClassMap,
Transformer valueTransformer)
Construct a new instance with the given registry and BSON type class map.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
decode(BsonReader reader,
DecoderContext decoderContext)
Decodes a BSON value from the given reader into an instance of the type parameter
T . |
void |
encode(BsonWriter writer,
java.util.Map<java.lang.String,java.lang.Object> map,
EncoderContext encoderContext)
Encode an instance of the type parameter
T into a BSON value. |
java.lang.Class<java.util.Map<java.lang.String,java.lang.Object>> |
getEncoderClass()
Returns the Class instance that this encodes.
|
public MapCodec()
CodecRegistry
public MapCodec(CodecRegistry registry)
registry
- the registrypublic MapCodec(CodecRegistry registry, BsonTypeClassMap bsonTypeClassMap)
registry
- the registrybsonTypeClassMap
- the BSON type class mappublic MapCodec(CodecRegistry registry, BsonTypeClassMap bsonTypeClassMap, Transformer valueTransformer)
registry
- the registrybsonTypeClassMap
- the BSON type class mapvalueTransformer
- the value transformer to use as a final step when decoding the value of any field in the mappublic void encode(BsonWriter writer, java.util.Map<java.lang.String,java.lang.Object> map, EncoderContext encoderContext)
Encoder
T
into a BSON value.public java.util.Map<java.lang.String,java.lang.Object> decode(BsonReader reader, DecoderContext decoderContext)
Decoder
T
.public java.lang.Class<java.util.Map<java.lang.String,java.lang.Object>> getEncoderClass()
Encoder
getEncoderClass
in interface Encoder<java.util.Map<java.lang.String,java.lang.Object>>