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 java.lang.Object implements org.bson.codecs.CollectibleCodec<T>
MongoDB Codec for all VitamDocument
-
-
Constructor Summary
Constructors Constructor Description VitamDocumentCodec(java.lang.Class<T> clazz)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
decode(org.bson.BsonReader reader, org.bson.codecs.DecoderContext decoderContext)
boolean
documentHasId(T document)
void
encode(org.bson.BsonWriter writer, T value, org.bson.codecs.EncoderContext encoderContext)
T
generateIdIfAbsentFromDocument(T document)
org.bson.BsonValue
getDocumentId(T document)
java.lang.Class<T>
getEncoderClass()
-
-
-
Constructor Detail
-
VitamDocumentCodec
public VitamDocumentCodec(java.lang.Class<T> clazz)
Constructor- Parameters:
clazz
- class of unknown type
-
-
Method Detail
-
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
public T generateIdIfAbsentFromDocument(T document)
- Specified by:
generateIdIfAbsentFromDocument
in interfaceorg.bson.codecs.CollectibleCodec<T extends org.bson.Document>
-
documentHasId
public boolean documentHasId(T document)
- Specified by:
documentHasId
in interfaceorg.bson.codecs.CollectibleCodec<T extends org.bson.Document>
-
getDocumentId
public org.bson.BsonValue getDocumentId(T document)
- Specified by:
getDocumentId
in interfaceorg.bson.codecs.CollectibleCodec<T extends org.bson.Document>
-
getEncoderClass
public java.lang.Class<T> getEncoderClass()
- Specified by:
getEncoderClass
in interfaceorg.bson.codecs.Encoder<T extends org.bson.Document>
-
-