Package dev.morphia.mapping.codec
Class CollectionCodec<T>
- java.lang.Object
-
- dev.morphia.mapping.codec.CollectionCodec<T>
-
- Type Parameters:
T
- parameterized type of the Collection
- All Implemented Interfaces:
org.bson.codecs.Codec<Collection<T>>
,org.bson.codecs.Decoder<Collection<T>>
,org.bson.codecs.Encoder<Collection<T>>
public class CollectionCodec<T> extends Object implements org.bson.codecs.Codec<Collection<T>>
A codec for Collection type
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CollectionCodec(Class<Collection<T>> encoderClass, org.bson.codecs.Codec<T> codec)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<T>
decode(org.bson.BsonReader reader, org.bson.codecs.DecoderContext context)
void
encode(org.bson.BsonWriter writer, Collection<T> collection, org.bson.codecs.EncoderContext encoderContext)
protected org.bson.codecs.Codec<T>
getCodec()
Class<Collection<T>>
getEncoderClass()
protected Collection<T>
getInstance()
-
-
-
Constructor Detail
-
CollectionCodec
protected CollectionCodec(Class<Collection<T>> encoderClass, org.bson.codecs.Codec<T> codec)
-
-
Method Detail
-
getCodec
protected org.bson.codecs.Codec<T> getCodec()
-
encode
public void encode(org.bson.BsonWriter writer, Collection<T> collection, org.bson.codecs.EncoderContext encoderContext)
- Specified by:
encode
in interfaceorg.bson.codecs.Encoder<T>
-
decode
public Collection<T> decode(org.bson.BsonReader reader, org.bson.codecs.DecoderContext context)
- Specified by:
decode
in interfaceorg.bson.codecs.Decoder<T>
-
getEncoderClass
public Class<Collection<T>> getEncoderClass()
- Specified by:
getEncoderClass
in interfaceorg.bson.codecs.Encoder<T>
-
getInstance
protected Collection<T> getInstance()
-
-