Record Class GsonRootObjectVisitor
java.lang.Object
java.lang.Record
eu.cloudnetservice.driver.document.gson.send.GsonRootObjectVisitor
- Record Components:
rootObject- the root json object to put all child elements into.
- All Implemented Interfaces:
ElementVisitor
public record GsonRootObjectVisitor(@NonNull com.google.gson.JsonObject rootObject)
extends Record
implements ElementVisitor
An element visitor to visit the root object element of a document send. This visitor only accepts calls to
visitObject(ObjectElement), all other calls with throw an UnsupportedOperationException.- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @NonNull com.google.gson.JsonObjectThe field for therootObjectrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionGsonRootObjectVisitor(@NonNull com.google.gson.JsonObject rootObject) Creates an instance of aGsonRootObjectVisitorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NonNull com.google.gson.JsonObjectReturns the value of therootObjectrecord component.final StringtoString()Returns a string representation of this record class.visitArray(@NonNull ArrayElement entry) Starts the visit of an array element.voidvisitEnd()Called when the end of visit for this visitor is reached.voidvisitNull(@NonNull NullElement entry) Visits a null element.visitObject(@NonNull ObjectElement entry) Starts the visit of an object element.voidVisits a primitive element.
-
Field Details
-
rootObject
The field for therootObjectrecord component.
-
-
Constructor Details
-
GsonRootObjectVisitor
Creates an instance of aGsonRootObjectVisitorrecord class.- Parameters:
rootObject- the value for therootObjectrecord component
-
-
Method Details
-
visitEnd
public void visitEnd()Called when the end of visit for this visitor is reached. That can for example be when all elements of an array element were processed.- Specified by:
visitEndin interfaceElementVisitor
-
visitNull
Visits a null element.- Specified by:
visitNullin interfaceElementVisitor- Parameters:
entry- the null element to visit.
-
visitPrimitive
Visits a primitive element.- Specified by:
visitPrimitivein interfaceElementVisitor- Parameters:
entry- the primitive element to visit.
-
visitArray
Starts the visit of an array element. The returned element visitor is used to visit each entry of the array.- Specified by:
visitArrayin interfaceElementVisitor- Parameters:
entry- the array element to visit.- Returns:
- the visitor to apply to all array entries.
-
visitObject
Starts the visit of an object element. The returned element visitor is used to visit each key-value mapping of the object.- Specified by:
visitObjectin interfaceElementVisitor- Parameters:
entry- the object element to visit.- Returns:
- the visitor to apply to all object key-value mappings.
-
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). -
rootObject
Returns the value of therootObjectrecord component.- Returns:
- the value of the
rootObjectrecord component
-