Package dev.morphia.mapping.codec
Class BitSetCodec
- java.lang.Object
-
- dev.morphia.mapping.codec.BitSetCodec
-
public class BitSetCodec extends Object implements Codec<BitSet>
Defines a codec for standardBitSet
. BitSet is encoded/decoded a an array of long integers.For compatibility with the legacy MongoDB driver, the codec can also decode a BitSet from a document if it contains a key named "words" whose value is an array of longs. Note that this legacy format is only available when LOADING a BitSet. When persisting a BitSet, it is always stored as an array of long integers.
-
-
Constructor Summary
Constructors Constructor Description BitSetCodec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BitSet
decode(BsonReader reader, DecoderContext decoderContext)
void
encode(BsonWriter writer, BitSet value, EncoderContext encoderContext)
Class<BitSet>
getEncoderClass()
-
-
-
Method Detail
-
encode
public void encode(BsonWriter writer, BitSet value, EncoderContext encoderContext)
-
decode
public BitSet decode(BsonReader reader, DecoderContext decoderContext)
-
getEncoderClass
public Class<BitSet> getEncoderClass()
- Specified by:
getEncoderClass
in interfaceEncoder<BitSet>
-
-