Record Class ViaDialogPayload

java.lang.Object
java.lang.Record
io.github.projectunified.unidialog.viaversion.payload.ViaDialogPayload
Record Components:
owner - the UUID of the player that triggered the action
compound - the payload data
All Implemented Interfaces:
DialogPayload

public record ViaDialogPayload(UUID owner, com.viaversion.nbt.tag.CompoundTag compound) extends Record implements DialogPayload
A ViaVersion-based implementation of DialogPayload.
  • Constructor Details

    • ViaDialogPayload

      public ViaDialogPayload(UUID owner, com.viaversion.nbt.tag.CompoundTag compound)
      Creates an instance of a ViaDialogPayload record class.
      Parameters:
      owner - the value for the owner record component
      compound - the value for the compound 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
    • compound

      public com.viaversion.nbt.tag.CompoundTag compound()
      Returns the value of the compound record component.
      Returns:
      the value of the compound record component