Class VitamDocumentCodec<T extends org.bson.Document>
java.lang.Object
fr.gouv.vitam.common.database.translators.mongodb.VitamDocumentCodec<T>
- Type Parameters:
T
- The parameter of the class
- All Implemented Interfaces:
org.bson.codecs.Codec<T>
,org.bson.codecs.CollectibleCodec<T>
,org.bson.codecs.Decoder<T>
,org.bson.codecs.Encoder<T>
public class VitamDocumentCodec<T extends org.bson.Document>
extends Object
implements org.bson.codecs.CollectibleCodec<T>
MongoDB Codec for all VitamDocument
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondecode
(org.bson.BsonReader reader, org.bson.codecs.DecoderContext decoderContext) boolean
documentHasId
(T document) void
generateIdIfAbsentFromDocument
(T document) org.bson.BsonValue
getDocumentId
(T document)
-
Constructor Details
-
VitamDocumentCodec
Constructor- Parameters:
clazz
- class of unknown type
-
-
Method Details
-
encode
public void encode(org.bson.BsonWriter writer, T value, org.bson.codecs.EncoderContext encoderContext) - Specified by:
encode
in interfaceorg.bson.codecs.Encoder<T extends org.bson.Document>
-
generateIdIfAbsentFromDocument
- Specified by:
generateIdIfAbsentFromDocument
in interfaceorg.bson.codecs.CollectibleCodec<T extends org.bson.Document>
-
documentHasId
- Specified by:
documentHasId
in interfaceorg.bson.codecs.CollectibleCodec<T extends org.bson.Document>
-
getDocumentId
- Specified by:
getDocumentId
in interfaceorg.bson.codecs.CollectibleCodec<T extends org.bson.Document>
-
getEncoderClass
- Specified by:
getEncoderClass
in interfaceorg.bson.codecs.Encoder<T extends org.bson.Document>
-
decode
- Specified by:
decode
in interfaceorg.bson.codecs.Decoder<T extends org.bson.Document>
-