Record Class PEDialogPayload

java.lang.Object
java.lang.Record
io.github.projectunified.unidialog.packetevents.payload.PEDialogPayload
All Implemented Interfaces:
DialogPayload

public record PEDialogPayload(UUID owner, com.github.retrooper.packetevents.protocol.nbt.NBTCompound compound) extends Record implements DialogPayload
  • Constructor Summary

    Constructors
    Constructor
    Description
    PEDialogPayload(UUID owner, com.github.retrooper.packetevents.protocol.nbt.NBTCompound compound)
    Creates an instance of a PEDialogPayload record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable Boolean
    Get the boolean value from the payload
    com.github.retrooper.packetevents.protocol.nbt.NBTCompound
    Returns the value of the compound record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    map()
    Get the map of all values in the payload
    @Nullable Number
    Get the number value from the payload
    Returns the value of the owner record component.
    @Nullable String
    Get the text value from the payload
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • PEDialogPayload

      public PEDialogPayload(UUID owner, com.github.retrooper.packetevents.protocol.nbt.NBTCompound compound)
      Creates an instance of a PEDialogPayload 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.github.retrooper.packetevents.protocol.nbt.NBTCompound compound()
      Returns the value of the compound record component.
      Returns:
      the value of the compound record component