Record Class SpigotDialogPayload

java.lang.Object
java.lang.Record
io.github.projectunified.unidialog.spigot.payload.SpigotDialogPayload
Record Components:
owner - the UUID of the player the payload belongs to
jsonData - the JSON data of the payload, may be null
All Implemented Interfaces:
DialogPayload

public record SpigotDialogPayload(UUID owner, @Nullable com.google.gson.JsonElement jsonData) extends Record implements DialogPayload
A dialog payload backed by a JSON element.
  • Constructor Details

    • SpigotDialogPayload

      public SpigotDialogPayload(UUID owner, @Nullable @Nullable com.google.gson.JsonElement jsonData)
      Creates an instance of a SpigotDialogPayload record class.
      Parameters:
      owner - the value for the owner record component
      jsonData - the value for the jsonData record component
  • Method Details

    • textValue

      @Nullable public @Nullable String textValue(String key)
      Description copied from interface: DialogPayload
      Get the text value from the payload
      Specified by:
      textValue in interface DialogPayload
      Parameters:
      key - the key to search for
      Returns:
      the text, or null if the key doesn't exist in the payload
    • booleanValue

      @Nullable public @Nullable Boolean booleanValue(String key)
      Description copied from interface: DialogPayload
      Get the boolean value from the payload
      Specified by:
      booleanValue in interface DialogPayload
      Parameters:
      key - the key to search for
      Returns:
      the boolean, or null if the key doesn't exist in the payload
    • numberValue

      @Nullable public @Nullable Number numberValue(String key)
      Description copied from interface: DialogPayload
      Get the number value from the payload
      Specified by:
      numberValue in interface DialogPayload
      Parameters:
      key - the key to search for
      Returns:
      the number, or null if the key doesn't exist in the payload or the value is not a number
    • map

      public Map<String,String> map()
      Description copied from interface: DialogPayload
      Get the map of all values in the payload
      Specified by:
      map in interface DialogPayload
      Returns:
      the map
    • 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.
    • owner

      public UUID owner()
      Returns the value of the owner record component.
      Specified by:
      owner in interface DialogPayload
      Returns:
      the value of the owner record component
    • jsonData

      @Nullable public @Nullable com.google.gson.JsonElement jsonData()
      Returns the value of the jsonData record component.
      Returns:
      the value of the jsonData record component