Class DefaultNoSqlObject

  • All Implemented Interfaces:
    NoSqlObject<java.util.Map<java.lang.String,​java.lang.Object>>

    public class DefaultNoSqlObject
    extends java.lang.Object
    implements NoSqlObject<java.util.Map<java.lang.String,​java.lang.Object>>
    Default implementation of NoSqlObject. Most NoSQL Java APIs tend to re-use the Map interface for storage and retrieval of the underlying JSON documents. Therefore, this implementation is provided for convenience.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.String,​java.lang.Object> map  
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultNoSqlObject()
      Constructs a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void set​(java.lang.String field, java.lang.Object value)
      Sets the value of a property on this object to a String or primitive.
      void set​(java.lang.String field, java.lang.Object[] values)
      Sets the value of a property on this object to an array of Strings or primitives.
      void set​(java.lang.String field, NoSqlObject<java.util.Map<java.lang.String,​java.lang.Object>> value)
      Sets the value of a property on this object to a nested complex object.
      void set​(java.lang.String field, NoSqlObject<java.util.Map<java.lang.String,​java.lang.Object>>[] values)
      Sets the value of a property on this object to an array of nested complex objects.
      java.util.Map<java.lang.String,​java.lang.Object> unwrap()
      Obtains the underlying NoSQL library-specific object that this object wraps.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • map

        private final java.util.Map<java.lang.String,​java.lang.Object> map
    • Constructor Detail

      • DefaultNoSqlObject

        public DefaultNoSqlObject()
        Constructs a new instance.
    • Method Detail

      • set

        public void set​(java.lang.String field,
                        java.lang.Object value)
        Description copied from interface: NoSqlObject
        Sets the value of a property on this object to a String or primitive.
        Specified by:
        set in interface NoSqlObject<java.util.Map<java.lang.String,​java.lang.Object>>
        Parameters:
        field - The name of the property
        value - The value of the property
      • set

        public void set​(java.lang.String field,
                        NoSqlObject<java.util.Map<java.lang.String,​java.lang.Object>> value)
        Description copied from interface: NoSqlObject
        Sets the value of a property on this object to a nested complex object.
        Specified by:
        set in interface NoSqlObject<java.util.Map<java.lang.String,​java.lang.Object>>
        Parameters:
        field - The name of the property
        value - The value of the property
      • set

        public void set​(java.lang.String field,
                        java.lang.Object[] values)
        Description copied from interface: NoSqlObject
        Sets the value of a property on this object to an array of Strings or primitives.
        Specified by:
        set in interface NoSqlObject<java.util.Map<java.lang.String,​java.lang.Object>>
        Parameters:
        field - The name of the property
        values - The values for the property
      • set

        public void set​(java.lang.String field,
                        NoSqlObject<java.util.Map<java.lang.String,​java.lang.Object>>[] values)
        Description copied from interface: NoSqlObject
        Sets the value of a property on this object to an array of nested complex objects.
        Specified by:
        set in interface NoSqlObject<java.util.Map<java.lang.String,​java.lang.Object>>
        Parameters:
        field - The name of the property
        values - The values for the property
      • unwrap

        public java.util.Map<java.lang.String,​java.lang.Object> unwrap()
        Description copied from interface: NoSqlObject
        Obtains the underlying NoSQL library-specific object that this object wraps.
        Specified by:
        unwrap in interface NoSqlObject<java.util.Map<java.lang.String,​java.lang.Object>>
        Returns:
        the wrapped object.