Package com.mongodb

Class LazyDBObject

  • All Implemented Interfaces:
    com.mongodb.DBObject, org.bson.BSONObject

    @Immutable
    public class LazyDBObject
    extends org.bson.LazyBSONObject
    implements com.mongodb.DBObject
    An immutable DBObject backed by a byte buffer that lazily provides keys and values on request. This is useful for transferring BSON documents between servers when you don't want to pay the performance penalty of encoding or decoding them fully.
    • Constructor Summary

      Constructors 
      Constructor Description
      LazyDBObject​(byte[] bytes, int offset, org.bson.LazyBSONCallback callback)
      Construct an instance.
      LazyDBObject​(byte[] bytes, org.bson.LazyBSONCallback callback)
      Construct an instance.
    • Constructor Detail

      • LazyDBObject

        public LazyDBObject​(byte[] bytes,
                            org.bson.LazyBSONCallback callback)
        Construct an instance.
        Parameters:
        bytes - the raw bytes
        callback - the callback to use to construct nested values
      • LazyDBObject

        public LazyDBObject​(byte[] bytes,
                            int offset,
                            org.bson.LazyBSONCallback callback)
        Construct an instance.
        Parameters:
        bytes - the raw bytes
        offset - the offset into the raw bytes
        callback - the callback to use to construct nested values
    • Method Detail

      • markAsPartialObject

        public void markAsPartialObject()
        Specified by:
        markAsPartialObject in interface com.mongodb.DBObject
      • isPartialObject

        public boolean isPartialObject()
        Specified by:
        isPartialObject in interface com.mongodb.DBObject
      • toString

        public String toString()
        Returns a JSON serialization of this object
        Overrides:
        toString in class Object
        Returns:
        JSON serialization