Package org.bson

Class BsonDocumentWrapper<T>

  • Type Parameters:
    T - the type of the document that is wrapped
    All Implemented Interfaces:
    Serializable, Cloneable, Map<String,BsonValue>, Bson


    public final class BsonDocumentWrapper<T>
    extends BsonDocument
    A BsonDocument that begins its life as a document of any type and an Encoder for that document, which lets an instance of any class with an Encoder be treated as a BsonDocument. If any methods are called which required access to the individual elements of the document, then, on demand, the document will be unwrapped into a BsonDocument using a BsonDocumentWriter and the Encoder. But if all that is done with this document is to encode it, then the Encoder will be used to do that.
    Since:
    3.0
    See Also:
    BsonDocumentWriter, Serialized Form