Class EmptyDocumentSend

java.lang.Object
eu.cloudnetservice.driver.document.empty.EmptyDocumentSend
All Implemented Interfaces:
DocumentSend

final class EmptyDocumentSend extends Object implements DocumentSend
A document send implementation that contains nothing.
Since:
4.0
  • Field Details

    • INSTANCE

      public static final DocumentSend INSTANCE
      The singleton instance of this document send implementation.
    • ROOT_ELEMENT

      private static final ObjectElement ROOT_ELEMENT
      The singleton instance of the root element returned by this document send. This element has no child elements set.
  • Constructor Details

    • EmptyDocumentSend

      private EmptyDocumentSend()
      Sealed constructor to prevent accidental instantiations of this class. Use the singleton instance from INSTANCE instead.
  • Method Details

    • rootElement

      @NonNull public @NonNull ObjectElement rootElement()
      Get the root element of the document send. As each document is supposed to use an object element as the root element this method always returns an object element.
      Specified by:
      rootElement in interface DocumentSend
      Returns:
      the root element of the document send.
    • into

      Receives this document into the given document factory. In normal cases the given document factory should create a new, empty document and import all supported key-value pairs that are supplied by this send into it.

      The receiving process of a document send should never throw an exception unless the given document send contains malformed or invalid data making it impossible to get imported.

      Specified by:
      into in interface DocumentSend
      Parameters:
      factory - the document factory that is supposed to receive this document send.
      Returns:
      a new, empty document containing all supported key-value pairs of the given document send.