Record Class TransferRequest
java.lang.Object
java.lang.Record
com.ultikits.ultitools.ui.TransferRequest
public record TransferRequest(org.bukkit.entity.Player viewer, TransferKind kind, int index, org.bukkit.inventory.ItemStack item, int amount)
extends Record
One proposed transfer of
amount of item at index. item is a copy.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for theamountrecord component.private final intThe field for theindexrecord component.private final org.bukkit.inventory.ItemStackThe field for theitemrecord component.private final TransferKindThe field for thekindrecord component.private final org.bukkit.entity.PlayerThe field for theviewerrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionTransferRequest(org.bukkit.entity.Player viewer, TransferKind kind, int index, org.bukkit.inventory.ItemStack item, int amount) Copies the item and rejects null references. -
Method Summary
Modifier and TypeMethodDescriptionintamount()Returns the value of theamountrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.org.bukkit.inventory.ItemStackitem()A fresh copy of the proposed item.kind()Returns the value of thekindrecord component.final StringtoString()Returns a string representation of this record class.org.bukkit.entity.Playerviewer()Returns the value of theviewerrecord component.
-
Field Details
-
viewer
private final org.bukkit.entity.Player viewerThe field for theviewerrecord component. -
kind
The field for thekindrecord component. -
index
private final int indexThe field for theindexrecord component. -
item
private final org.bukkit.inventory.ItemStack itemThe field for theitemrecord component. -
amount
private final int amountThe field for theamountrecord component.
-
-
Constructor Details
-
TransferRequest
public TransferRequest(org.bukkit.entity.Player viewer, TransferKind kind, int index, org.bukkit.inventory.ItemStack item, int amount) Copies the item and rejects null references.
-
-
Method Details
-
item
public org.bukkit.inventory.ItemStack item()A fresh copy of the proposed item. -
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
viewer
public org.bukkit.entity.Player viewer()Returns the value of theviewerrecord component.- Returns:
- the value of the
viewerrecord component
-
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-
amount
public int amount()Returns the value of theamountrecord component.- Returns:
- the value of the
amountrecord component
-