Class DurationAsDecimal128Codec

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

    public final class DurationAsDecimal128Codec
    extends Object
    implements Codec<Duration>

    Encodes and decodes Duration values to and from BSON Decimal128, such as 10.100_000_000.

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

    • the first part represents seconds;
    • the latter part represents nanoseconds.

    This type is immutable.