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 actioncompound- 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 Summary
ConstructorsConstructorDescriptionViaDialogPayload(UUID owner, com.viaversion.nbt.tag.CompoundTag compound) Creates an instance of aViaDialogPayloadrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable BooleanbooleanValue(String key) Get the boolean value from the payloadcom.viaversion.nbt.tag.CompoundTagcompound()Returns the value of thecompoundrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.map()Get the map of all values in the payload@Nullable NumbernumberValue(String key) Get the number value from the payloadowner()Returns the value of theownerrecord component.@Nullable StringGet the text value from the payloadfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
textValue
Description copied from interface:DialogPayloadGet the text value from the payload- Specified by:
textValuein interfaceDialogPayload- Parameters:
key- the key to search for- Returns:
- the text, or null if the key doesn't exist in the payload
-
booleanValue
Description copied from interface:DialogPayloadGet the boolean value from the payload- Specified by:
booleanValuein interfaceDialogPayload- Parameters:
key- the key to search for- Returns:
- the boolean, or null if the key doesn't exist in the payload
-
numberValue
Description copied from interface:DialogPayloadGet the number value from the payload- Specified by:
numberValuein interfaceDialogPayload- 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
Description copied from interface:DialogPayloadGet the map of all values in the payload- Specified by:
mapin interfaceDialogPayload- Returns:
- the map
-
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. -
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. -
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). -
owner
Returns the value of theownerrecord component.- Specified by:
ownerin interfaceDialogPayload- Returns:
- the value of the
ownerrecord component
-
compound
public com.viaversion.nbt.tag.CompoundTag compound()Returns the value of thecompoundrecord component.- Returns:
- the value of the
compoundrecord component
-