Class YearMonthAsDocumentCodec

  • All Implemented Interfaces:
    Codec<YearMonth>, Decoder<YearMonth>, Encoder<YearMonth>

    public final class YearMonthAsDocumentCodec
    extends Object
    implements Codec<YearMonth>

    Encodes and decodes YearMonth values to and from BSON Document, such as { year: 2018, month: 1 }.

    The values are stored using the following structure:

    • year (a non-null Int32);
    • month (a non-null Int32).

    This type is immutable.