Package dev.morphia.mapping.codec
Class KeyCodec
- java.lang.Object
-
- dev.morphia.mapping.codec.KeyCodec
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Key
decode(org.bson.BsonReader reader, org.bson.codecs.DecoderContext decoderContext)
Decodes a BSON value from the given reader into an instance of the type parameterT
.void
encode(org.bson.BsonWriter writer, Key value, org.bson.codecs.EncoderContext encoderContext)
Encode an instance of the type parameterT
into a BSON value.Class<Key>
getEncoderClass()
Returns the Class instance that this encodes.
-
-
-
Method Detail
-
encode
public void encode(org.bson.BsonWriter writer, Key value, org.bson.codecs.EncoderContext encoderContext)
Description copied from interface:org.bson.codecs.Encoder
Encode an instance of the type parameterT
into a BSON value.- Specified by:
encode
in interfaceorg.bson.codecs.Encoder<Key>
- Parameters:
writer
- the BSON writer to encode intovalue
- the value to encodeencoderContext
- the encoder context
-
getEncoderClass
public Class<Key> getEncoderClass()
Description copied from interface:org.bson.codecs.Encoder
Returns the Class instance that this encodes. This is necessary because Java does not reify generic types.- Specified by:
getEncoderClass
in interfaceorg.bson.codecs.Encoder<Key>
- Returns:
- the Class instance that this encodes.
-
decode
public Key decode(org.bson.BsonReader reader, org.bson.codecs.DecoderContext decoderContext)
Description copied from interface:org.bson.codecs.Decoder
Decodes a BSON value from the given reader into an instance of the type parameterT
.- Specified by:
decode
in interfaceorg.bson.codecs.Decoder<Key>
- Parameters:
reader
- the BSON readerdecoderContext
- the decoder context- Returns:
- an instance of the type parameter
T
.
-
-