Class Document

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Document​(DocumentType documentType)
      Constructs an empty instance of Document.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      boolean containsKey​(java.lang.Object key)  
      boolean containsValue​(java.lang.Object value)  
      java.util.Set<java.util.Map.Entry<java.lang.String,​java.io.Serializable>> entrySet()  
      java.io.Serializable get​(java.lang.Object key)  
      java.io.Serializable get​(DocumentTypeField field)
      Returns the value stored in this document using the given field identifier as key.
      DocumentType getDocumentType()
      Returns the document type of this document.
      java.lang.String getId()
      Returns the identifier of this document.
      boolean isEmpty()  
      java.util.Set<java.lang.String> keySet()  
      protected <T> T newFieldValueProxy​(DocumentTypeField field, java.lang.Class<T> proxyInterface)
      Creates a new proxy for a document root field value.
      java.io.Serializable put​(java.lang.String key, java.io.Serializable value)  
      java.io.Serializable put​(DocumentTypeField field, java.io.Serializable... values)
      Stores the given value in this document using the given field identifier as key.
      void putAll​(java.util.Map<? extends java.lang.String,​? extends java.io.Serializable> m)  
      java.io.Serializable remove​(java.lang.Object key)  
      void setId​(java.lang.String id)
      Sets the identifier of this document.
      int size()  
      java.util.Collection<java.io.Serializable> values()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
    • Constructor Detail

      • Document

        protected Document​(DocumentType documentType)
        Constructs an empty instance of Document.
        Parameters:
        id - the identifier of this document.
        documentType - the document type of this document.
        Throws:
        java.lang.IllegalArgumentException - if the given identifier is null.
        java.lang.IllegalArgumentException - if the given DocumentType is null.
        Since:
        8.1.0
    • Method Detail

      • newFieldValueProxy

        protected <T> T newFieldValueProxy​(DocumentTypeField field,
                                           java.lang.Class<T> proxyInterface)
        Creates a new proxy for a document root field value.
        Parameters:
        field - the field.
        proxyInterface - the interface the proxy must implement.
        Returns:
        the proxy.
        Since:
        8.1.0
      • getId

        public java.lang.String getId()
        Returns the identifier of this document.
        Returns:
        the identifier.
        Since:
        11.0.0
      • setId

        public void setId​(java.lang.String id)
        Sets the identifier of this document.
        Parameters:
        id - the identifier.
        Since:
        11.0.0
      • size

        public int size()
        Specified by:
        size in interface java.util.Map<java.lang.String,​java.io.Serializable>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Map<java.lang.String,​java.io.Serializable>
      • get

        public java.io.Serializable get​(java.lang.Object key)
        Specified by:
        get in interface java.util.Map<java.lang.String,​java.io.Serializable>
      • get

        public java.io.Serializable get​(DocumentTypeField field)
        Returns the value stored in this document using the given field identifier as key.
        Parameters:
        field - the field.
        Returns:
        the value stored in this document using the given field identifier as key.
        Since:
        8.1.0
        See Also:
        get(Object)
      • containsKey

        public boolean containsKey​(java.lang.Object key)
        Specified by:
        containsKey in interface java.util.Map<java.lang.String,​java.io.Serializable>
      • put

        public java.io.Serializable put​(java.lang.String key,
                                        java.io.Serializable value)
        Specified by:
        put in interface java.util.Map<java.lang.String,​java.io.Serializable>
      • put

        public java.io.Serializable put​(DocumentTypeField field,
                                        java.io.Serializable... values)
        Stores the given value in this document using the given field identifier as key.
        Parameters:
        field - the field.
        value - the value.
        Returns:
        the previously stored value.
        Since:
        8.1.0
        See Also:
        put(String, Serializable)
      • putAll

        public void putAll​(java.util.Map<? extends java.lang.String,​? extends java.io.Serializable> m)
        Specified by:
        putAll in interface java.util.Map<java.lang.String,​java.io.Serializable>
      • remove

        public java.io.Serializable remove​(java.lang.Object key)
        Specified by:
        remove in interface java.util.Map<java.lang.String,​java.io.Serializable>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Map<java.lang.String,​java.io.Serializable>
      • containsValue

        public boolean containsValue​(java.lang.Object value)
        Specified by:
        containsValue in interface java.util.Map<java.lang.String,​java.io.Serializable>
      • keySet

        public java.util.Set<java.lang.String> keySet()
        Specified by:
        keySet in interface java.util.Map<java.lang.String,​java.io.Serializable>
      • values

        public java.util.Collection<java.io.Serializable> values()
        Specified by:
        values in interface java.util.Map<java.lang.String,​java.io.Serializable>
      • entrySet

        public java.util.Set<java.util.Map.Entry<java.lang.String,​java.io.Serializable>> entrySet()
        Specified by:
        entrySet in interface java.util.Map<java.lang.String,​java.io.Serializable>