Package org.bson.codecs
Class IterableCodec
- java.lang.Object
 - 
- org.bson.codecs.IterableCodec
 
 
- 
- All Implemented Interfaces:
 Codec<java.lang.Iterable>,Decoder<java.lang.Iterable>,Encoder<java.lang.Iterable>,OverridableUuidRepresentationCodec<java.lang.Iterable>
public class IterableCodec extends java.lang.Object implements Codec<java.lang.Iterable>, OverridableUuidRepresentationCodec<java.lang.Iterable>
Encodes and decodesIterableobjects.- Since:
 - 3.3
 
 
- 
- 
Constructor Summary
Constructors Constructor Description IterableCodec(CodecRegistry registry, BsonTypeClassMap bsonTypeClassMap)Construct a new instance with the givenCodecRegistryandBsonTypeClassMap.IterableCodec(CodecRegistry registry, BsonTypeClassMap bsonTypeClassMap, Transformer valueTransformer)Construct a new instance with the givenCodecRegistryandBsonTypeClassMap. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Iterabledecode(BsonReader reader, DecoderContext decoderContext)Decodes a BSON value from the given reader into an instance of the type parameterT.voidencode(BsonWriter writer, java.lang.Iterable value, EncoderContext encoderContext)Encode an instance of the type parameterTinto a BSON value.java.lang.Class<java.lang.Iterable>getEncoderClass()Returns the Class instance that this encodes.Codec<java.lang.Iterable>withUuidRepresentation(UuidRepresentation uuidRepresentation)Implementations must return a new instance with theUuidRepresentationoverridden with the given value. 
 - 
 
- 
- 
Constructor Detail
- 
IterableCodec
public IterableCodec(CodecRegistry registry, BsonTypeClassMap bsonTypeClassMap)
Construct a new instance with the givenCodecRegistryandBsonTypeClassMap.- Parameters:
 registry- the non-null codec registrybsonTypeClassMap- the non-null BsonTypeClassMap
 
- 
IterableCodec
public IterableCodec(CodecRegistry registry, BsonTypeClassMap bsonTypeClassMap, Transformer valueTransformer)
Construct a new instance with the givenCodecRegistryandBsonTypeClassMap.- Parameters:
 registry- the non-null codec registrybsonTypeClassMap- the non-null BsonTypeClassMapvalueTransformer- the value Transformer
 
 - 
 
- 
Method Detail
- 
withUuidRepresentation
public Codec<java.lang.Iterable> withUuidRepresentation(UuidRepresentation uuidRepresentation)
Description copied from interface:OverridableUuidRepresentationCodecImplementations must return a new instance with theUuidRepresentationoverridden with the given value.- Specified by:
 withUuidRepresentationin interfaceOverridableUuidRepresentationCodec<java.lang.Iterable>- Parameters:
 uuidRepresentation- the UuidRepresentation- Returns:
 - a new instance equivalent to this but with the given UuidRepresentation
 
 
- 
decode
public java.lang.Iterable decode(BsonReader reader, DecoderContext decoderContext)
Description copied from interface:DecoderDecodes a BSON value from the given reader into an instance of the type parameterT. 
- 
encode
public void encode(BsonWriter writer, java.lang.Iterable value, EncoderContext encoderContext)
Description copied from interface:EncoderEncode an instance of the type parameterTinto a BSON value. 
- 
getEncoderClass
public java.lang.Class<java.lang.Iterable> getEncoderClass()
Description copied from interface:EncoderReturns the Class instance that this encodes. This is necessary because Java does not reify generic types.- Specified by:
 getEncoderClassin interfaceEncoder<java.lang.Iterable>- Returns:
 - the Class instance that this encodes.
 
 
 - 
 
 -