Class EmptyDocumentSend
java.lang.Object
eu.cloudnetservice.driver.document.empty.EmptyDocumentSend
- All Implemented Interfaces:
DocumentSend
A document send implementation that contains nothing.
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DocumentSendThe singleton instance of this document send implementation.private static final ObjectElementThe singleton instance of the root element returned by this document send. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSealed constructor to prevent accidental instantiations of this class. -
Method Summary
Modifier and TypeMethodDescriptioninto(@NonNull DocumentFactory factory) Receives this document into the given document factory.Get the root element of the document send.
-
Field Details
-
INSTANCE
The singleton instance of this document send implementation. -
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 fromINSTANCEinstead.
-
-
Method Details
-
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:
rootElementin interfaceDocumentSend- 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:
intoin interfaceDocumentSend- 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.
-