Package com.mongodb

Class BasicDBObjectBuilder


  • @Deprecated(since="2021-05-27")
    public class BasicDBObjectBuilder
    extends java.lang.Object
    Deprecated.
    Usage of this API is not supported in AEM as a Cloud Service.

    Utility for building complex objects. For example:

        BasicDBObjectBuilder.start().add( "name" , "eliot").add("number" , 17).get()
      
    • Constructor Summary

      Constructors 
      Constructor Description
      BasicDBObjectBuilder()
      Deprecated.
      Creates a builder intialized with an empty document.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      BasicDBObjectBuilder add​(java.lang.String key, java.lang.Object val)
      Deprecated.
      Same as append
      BasicDBObjectBuilder append​(java.lang.String key, java.lang.Object val)
      Deprecated.
      Appends the key/value to the active object
      DBObject get()
      Deprecated.
      Gets the top level document.
      boolean isEmpty()
      Deprecated.
      Returns true if no key/value was inserted into the top level document.
      BasicDBObjectBuilder pop()
      Deprecated.
      Pops the active object, which means that the parent object becomes active
      BasicDBObjectBuilder push​(java.lang.String key)
      Deprecated.
      Creates an new empty object and inserts it into the current object with the given key.
      static BasicDBObjectBuilder start()
      Deprecated.
      Creates a builder intialized with an empty document.
      static BasicDBObjectBuilder start​(java.lang.String key, java.lang.Object val)
      Deprecated.
      Creates a builder initialized with the given key/value.
      static BasicDBObjectBuilder start​(java.util.Map documentAsMap)
      Deprecated.
      Creates an object builder from an existing map of key value pairs.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BasicDBObjectBuilder

        public BasicDBObjectBuilder()
        Deprecated.
        Creates a builder intialized with an empty document.
    • Method Detail

      • start

        public static BasicDBObjectBuilder start()
        Deprecated.
        Creates a builder intialized with an empty document.
        Returns:
        The new empty builder
      • start

        public static BasicDBObjectBuilder start​(java.lang.String key,
                                                 java.lang.Object val)
        Deprecated.
        Creates a builder initialized with the given key/value.
        Parameters:
        key - The field name
        val - The value
        Returns:
        the new builder
      • start

        public static BasicDBObjectBuilder start​(java.util.Map documentAsMap)
        Deprecated.
        Creates an object builder from an existing map of key value pairs.
        Parameters:
        documentAsMap - a document in Map form.
        Returns:
        the new builder
      • append

        public BasicDBObjectBuilder append​(java.lang.String key,
                                           java.lang.Object val)
        Deprecated.
        Appends the key/value to the active object
        Parameters:
        key - the field name
        val - the value of the field
        Returns:
        this so calls can be chained
      • add

        public BasicDBObjectBuilder add​(java.lang.String key,
                                        java.lang.Object val)
        Deprecated.
        Same as append
        Parameters:
        key - the field name
        val - the value of the field
        Returns:
        this so calls can be chained
        See Also:
        append(String, Object)
      • push

        public BasicDBObjectBuilder push​(java.lang.String key)
        Deprecated.
        Creates an new empty object and inserts it into the current object with the given key. The new child object becomes the active one.
        Parameters:
        key - the field name
        Returns:
        this so calls can be chained
      • pop

        public BasicDBObjectBuilder pop()
        Deprecated.
        Pops the active object, which means that the parent object becomes active
        Returns:
        this so calls can be chained
      • get

        public DBObject get()
        Deprecated.
        Gets the top level document.
        Returns:
        The base object
      • isEmpty

        public boolean isEmpty()
        Deprecated.
        Returns true if no key/value was inserted into the top level document.
        Returns:
        true if empty