Record Class GsonDocumentSend
java.lang.Object
java.lang.Record
eu.cloudnetservice.driver.impl.document.gson.send.GsonDocumentSend
- Record Components:
rootElement- the root object element of the document send.
- All Implemented Interfaces:
eu.cloudnetservice.driver.document.send.DocumentSend
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @NonNull eu.cloudnetservice.driver.document.send.element.ObjectElementThe field for therootElementrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionGsonDocumentSend(@NonNull eu.cloudnetservice.driver.document.send.element.ObjectElement rootElement) Creates an instance of aGsonDocumentSendrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static @NonNull eu.cloudnetservice.driver.document.send.DocumentSendfromJsonObject(@NonNull com.google.gson.JsonObject object) Constructs a document send instance from the given gson json object.final inthashCode()Returns a hash code value for this object.eu.cloudnetservice.driver.document.Document.Mutable@NonNull eu.cloudnetservice.driver.document.send.element.ObjectElementReturns the value of therootElementrecord component.private static @NonNull eu.cloudnetservice.driver.document.send.element.ArrayElementserializeArray(@NonNull String key, @NonNull com.google.gson.JsonArray array) Serialises the given gson json array into an array element.private static @NonNull eu.cloudnetservice.driver.document.send.element.ObjectElementserializeObject(@NonNull String key, @NonNull com.google.gson.JsonObject object) Serialises the given gson json object into an object element.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
rootElement
@NonNull private final @NonNull eu.cloudnetservice.driver.document.send.element.ObjectElement rootElementThe field for therootElementrecord component.
-
-
Constructor Details
-
GsonDocumentSend
public GsonDocumentSend(@NonNull @NonNull eu.cloudnetservice.driver.document.send.element.ObjectElement rootElement) Creates an instance of aGsonDocumentSendrecord class.- Parameters:
rootElement- the value for therootElementrecord component
-
-
Method Details
-
fromJsonObject
@NonNull public static @NonNull eu.cloudnetservice.driver.document.send.DocumentSend fromJsonObject(@NonNull @NonNull com.google.gson.JsonObject object) Constructs a document send instance from the given gson json object.- Parameters:
object- the json object to construct the document send from.- Returns:
- the document send constructed from the given json object.
- Throws:
NullPointerException- if the given json object is null.
-
serializeObject
@NonNull private static @NonNull eu.cloudnetservice.driver.document.send.element.ObjectElement serializeObject(@NonNull @NonNull String key, @NonNull @NonNull com.google.gson.JsonObject object) Serialises the given gson json object into an object element.- Parameters:
key- the key of the given json object.object- the object to serialize.- Returns:
- an object element serialized from the given gson json object.
- Throws:
NullPointerException- if the given key or json object is null.
-
serializeArray
@NonNull private static @NonNull eu.cloudnetservice.driver.document.send.element.ArrayElement serializeArray(@NonNull @NonNull String key, @NonNull @NonNull com.google.gson.JsonArray array) Serialises the given gson json array into an array element.- Parameters:
key- the key of the given json array.array- the array to serialize.- Returns:
- an array element serialized from the given gson json array.
- Throws:
NullPointerException- if the given key or json array is null.
-
into
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
rootElement
@NonNull public @NonNull eu.cloudnetservice.driver.document.send.element.ObjectElement rootElement()Returns the value of therootElementrecord component.- Specified by:
rootElementin interfaceeu.cloudnetservice.driver.document.send.DocumentSend- Returns:
- the value of the
rootElementrecord component
-