Class YearMonthAsDecimal128Codec

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

    public final class YearMonthAsDecimal128Codec
    extends Object
    implements Codec<YearMonth>

    Encodes and decodes YearMonth values to and from BSON Decimal128, such as 2018.01.

    The values are stored using the following format: %d.%02d

    • the first part represents a year;
    • the latter part represents a month of this year.

    This type is immutable.