public class MapCodec extends java.lang.Object implements Codec<java.util.Map<java.lang.String,java.lang.Object>>, OverridableUuidRepresentationCodec<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.
|
Codec<java.util.Map<java.lang.String,java.lang.Object>> |
withUuidRepresentation(UuidRepresentation uuidRepresentation)
Implementations must return a new instance with the
UuidRepresentation overridden with the given value. |
public MapCodec()
CodecRegistrypublic 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 Codec<java.util.Map<java.lang.String,java.lang.Object>> withUuidRepresentation(UuidRepresentation uuidRepresentation)
OverridableUuidRepresentationCodecUuidRepresentation overridden with the given value.withUuidRepresentation in interface OverridableUuidRepresentationCodec<java.util.Map<java.lang.String,java.lang.Object>>uuidRepresentation - the UuidRepresentationpublic void encode(BsonWriter writer, java.util.Map<java.lang.String,java.lang.Object> map, EncoderContext encoderContext)
EncoderT into a BSON value.public java.util.Map<java.lang.String,java.lang.Object> decode(BsonReader reader, DecoderContext decoderContext)
DecoderT.public java.lang.Class<java.util.Map<java.lang.String,java.lang.Object>> getEncoderClass()
EncodergetEncoderClass in interface Encoder<java.util.Map<java.lang.String,java.lang.Object>>Copyright © 2010 - 2023 Adobe. All Rights Reserved