Class InstantAsDocumentCodec

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

    public final class InstantAsDocumentCodec
    extends Object
    implements Codec<Instant>

    Encodes and decodes Instant values to and from BSON Document, such as { seconds: 1514888130, nanos: 0 }.

    The values are stored using the following structure:

    • seconds (a non-null Int64);
    • nanos (a non-null Int32).

    This type is immutable.