Package com.mongodb
Class DBRefCodec
java.lang.Object
com.mongodb.DBRefCodec
- All Implemented Interfaces:
org.bson.codecs.Codec<DBRef>
,org.bson.codecs.Decoder<DBRef>
,org.bson.codecs.Encoder<DBRef>
A Codec for DBRef instances.
- Since:
- 3.0
-
Constructor Summary
ConstructorsConstructorDescriptionDBRefCodec
(org.bson.codecs.configuration.CodecRegistry registry) Construct an instance with the given registry, which is used to encode the id of the referenced document. -
Method Summary
-
Constructor Details
-
DBRefCodec
public DBRefCodec(org.bson.codecs.configuration.CodecRegistry registry) Construct an instance with the given registry, which is used to encode the id of the referenced document.- Parameters:
registry
- the non-null codec registry
-
-
Method Details
-
encode
public void encode(org.bson.BsonWriter writer, DBRef value, org.bson.codecs.EncoderContext encoderContext) - Specified by:
encode
in interfaceorg.bson.codecs.Encoder<DBRef>
-
getEncoderClass
- Specified by:
getEncoderClass
in interfaceorg.bson.codecs.Encoder<DBRef>
-
decode
- Specified by:
decode
in interfaceorg.bson.codecs.Decoder<DBRef>
-