public final class YearMonthAsStringCodec extends Object implements Codec<YearMonth>
Encodes and decodes YearMonth
values to and from
BSON String
, such as
2018-01
.
The values are stored as quasi ISO-8601
formatted strings
(see YearMonth
). Note that the years greater than
9999
are prefixed with the +
sign.
This type is immutable.
Constructor and Description |
---|
YearMonthAsStringCodec() |
Modifier and Type | Method and Description |
---|---|
YearMonth |
decode(BsonReader reader,
DecoderContext decoderContext) |
void |
encode(BsonWriter writer,
YearMonth value,
EncoderContext encoderContext) |
Class<YearMonth> |
getEncoderClass() |
public void encode(BsonWriter writer, YearMonth value, EncoderContext encoderContext)
public YearMonth decode(BsonReader reader, DecoderContext decoderContext)
public Class<YearMonth> getEncoderClass()
getEncoderClass
in interface Encoder<YearMonth>
Copyright © 2018. All rights reserved.