Record Class GsonArrayVisitor

java.lang.Object
java.lang.Record
eu.cloudnetservice.driver.impl.document.gson.send.GsonArrayVisitor
Record Components:
targetArray - the target gson json array to put all visited elements into.
All Implemented Interfaces:
eu.cloudnetservice.driver.document.send.ElementVisitor

record GsonArrayVisitor(@NonNull com.google.gson.JsonArray targetArray) extends Record implements eu.cloudnetservice.driver.document.send.ElementVisitor
An element visitor specifically made to transform all given values into a gson json array.
Since:
4.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final @NonNull com.google.gson.JsonArray
    The field for the targetArray record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GsonArrayVisitor(@NonNull com.google.gson.JsonArray targetArray)
    Creates an instance of a GsonArrayVisitor record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @NonNull com.google.gson.JsonArray
    Returns the value of the targetArray record component.
    final String
    Returns a string representation of this record class.
    @NonNull eu.cloudnetservice.driver.document.send.ElementVisitor
    visitArray(@NonNull eu.cloudnetservice.driver.document.send.element.ArrayElement entry)
    void
    void
    visitNull(@NonNull eu.cloudnetservice.driver.document.send.element.NullElement entry)
    @NonNull eu.cloudnetservice.driver.document.send.ElementVisitor
    visitObject(@NonNull eu.cloudnetservice.driver.document.send.element.ObjectElement entry)
    void
    visitPrimitive(@NonNull eu.cloudnetservice.driver.document.send.element.PrimitiveElement entry)

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • GsonArrayVisitor

      GsonArrayVisitor(@NonNull @NonNull com.google.gson.JsonArray targetArray)
      Creates an instance of a GsonArrayVisitor record class.
      Parameters:
      targetArray - the value for the targetArray record component
  • Method Details

    • visitEnd

      public void visitEnd()
      Specified by:
      visitEnd in interface eu.cloudnetservice.driver.document.send.ElementVisitor
    • visitNull

      public void visitNull(@NonNull @NonNull eu.cloudnetservice.driver.document.send.element.NullElement entry)
      Specified by:
      visitNull in interface eu.cloudnetservice.driver.document.send.ElementVisitor
    • visitPrimitive

      public void visitPrimitive(@NonNull @NonNull eu.cloudnetservice.driver.document.send.element.PrimitiveElement entry)
      Specified by:
      visitPrimitive in interface eu.cloudnetservice.driver.document.send.ElementVisitor
    • visitArray

      @NonNull public @NonNull eu.cloudnetservice.driver.document.send.ElementVisitor visitArray(@NonNull @NonNull eu.cloudnetservice.driver.document.send.element.ArrayElement entry)
      Specified by:
      visitArray in interface eu.cloudnetservice.driver.document.send.ElementVisitor
    • visitObject

      @NonNull public @NonNull eu.cloudnetservice.driver.document.send.ElementVisitor visitObject(@NonNull @NonNull eu.cloudnetservice.driver.document.send.element.ObjectElement entry)
      Specified by:
      visitObject in interface eu.cloudnetservice.driver.document.send.ElementVisitor
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • targetArray

      @NonNull public @NonNull com.google.gson.JsonArray targetArray()
      Returns the value of the targetArray record component.
      Returns:
      the value of the targetArray record component