Class BaseDocument

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  BaseDocument.Entry
      Represents a key-value pair in the document.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Hashtable<java.lang.String,​java.lang.Object> data  
    • Constructor Summary

      Constructors 
      Constructor Description
      BaseDocument​(Module coll, java.time.Instant ts)
      Initializes a new instance of the BaseDocument class with the specified collection and timestamp.
      BaseDocument​(Module coll, java.time.Instant ts, java.util.Map<java.lang.String,​java.lang.Object> data)
      Initializes a new instance of the BaseDocument class with the specified collection, timestamp, and initial data.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean containsKey​(java.lang.String key)
      Determines whether the document contains the specified key.
      java.lang.Object get​(java.lang.String key)
      Gets the value associated with the specified key.
      Module getCollection()
      Gets the collection to which the document belongs.
      java.util.Map<java.lang.String,​java.lang.Object> getData()
      Gets a copy of the underlying data as a Map.
      java.time.Instant getTs()
      Gets the timestamp of the document.
      java.util.Iterator<BaseDocument.Entry> iterator()
      Returns an iterator over the elements in this document.
      int size()
      Gets the count of key-value pairs contained in the document.
      • Methods inherited from class java.lang.Object

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

        forEach, spliterator
    • Field Detail

      • data

        protected final java.util.Hashtable<java.lang.String,​java.lang.Object> data
    • Constructor Detail

      • BaseDocument

        public BaseDocument​(Module coll,
                            java.time.Instant ts)
        Initializes a new instance of the BaseDocument class with the specified collection and timestamp.
        Parameters:
        coll - The collection to which the document belongs.
        ts - The timestamp of the document.
      • BaseDocument

        public BaseDocument​(Module coll,
                            java.time.Instant ts,
                            java.util.Map<java.lang.String,​java.lang.Object> data)
        Initializes a new instance of the BaseDocument class with the specified collection, timestamp, and initial data.
        Parameters:
        coll - The collection to which the document belongs.
        ts - The timestamp of the document.
        data - Initial data for the document in key-value pairs.
    • Method Detail

      • iterator

        public java.util.Iterator<BaseDocument.Entry> iterator()
        Returns an iterator over the elements in this document.
        Specified by:
        iterator in interface java.lang.Iterable<BaseDocument.Entry>
        Returns:
        an iterator over the elements in this document.
      • getTs

        public java.time.Instant getTs()
        Gets the timestamp of the document.
        Returns:
        The Instant of the document.
      • getCollection

        public Module getCollection()
        Gets the collection to which the document belongs.
        Returns:
        The collection to which the document belongs.
      • getData

        public java.util.Map<java.lang.String,​java.lang.Object> getData()
        Gets a copy of the underlying data as a Map.
        Returns:
        The data.
      • size

        public int size()
        Gets the count of key-value pairs contained in the document.
        Returns:
        The number of key-value pairs.
      • containsKey

        public boolean containsKey​(java.lang.String key)
        Determines whether the document contains the specified key.
        Parameters:
        key - The key to locate in the document.
        Returns:
        true if the document contains an element with the specified key; otherwise, false.
      • get

        public java.lang.Object get​(java.lang.String key)
        Gets the value associated with the specified key.
        Parameters:
        key - The key of the value to get.
        Returns:
        The value associated with the specified key, or null if the key is not found.