Class NullDocument<T>

  • Type Parameters:
    T - The type of the document content, although it will not contain an actual value.

    public final class NullDocument<T>
    extends NullableDocument<T>
    Represents a document that is explicitly null, providing information about the cause of its null state. This class extends NullableDocument and throws a NullDocumentException when accessed.
    • Constructor Summary

      Constructors 
      Constructor Description
      NullDocument​(java.lang.String id, Module coll, java.lang.String cause)
      Constructs a NullDocument with the specified ID, collection, and cause of nullity.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)
      Checks if this null document is equal to another object.
      T get()
      Throws a NullDocumentException when called, as this document is explicitly null.
      java.lang.String getCause()
      Retrieves the cause of the document's null state.
      Module getCollection()
      Retrieves the collection associated with the null document.
      java.lang.String getId()
      Retrieves the ID of the null document.
      int hashCode()
      Returns a hash code value for this null document based on its ID, collection, and cause.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NullDocument

        public NullDocument​(java.lang.String id,
                            Module coll,
                            java.lang.String cause)
        Constructs a NullDocument with the specified ID, collection, and cause of nullity.
        Parameters:
        id - The unique identifier of the document.
        coll - The module (collection) to which this null document belongs.
        cause - A description of the reason why the document is null.
    • Method Detail

      • getCause

        public java.lang.String getCause()
        Retrieves the cause of the document's null state.
        Returns:
        A String describing the cause of the null document.
      • getId

        public java.lang.String getId()
        Retrieves the ID of the null document.
        Returns:
        A String representing the document's ID.
      • getCollection

        public Module getCollection()
        Retrieves the collection associated with the null document.
        Returns:
        A Module representing the collection to which this null document belongs.
      • equals

        public boolean equals​(java.lang.Object o)
        Checks if this null document is equal to another object. Two NullDocument objects are considered equal if they have the same ID, collection, and cause.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - The object to compare with this null document for equality.
        Returns:
        true if the specified object is equal to this null document; otherwise, false.
      • hashCode

        public int hashCode()
        Returns a hash code value for this null document based on its ID, collection, and cause.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        An integer hash code for this null document.