Package com.enhancedechest.model
Record Class EnderChestData
java.lang.Object
java.lang.Record
com.enhancedechest.model.EnderChestData
- Record Components:
owner- the owning playerindex- 1-based chest index (also drives the default "Ender Chest N" title)size- slot count — always a multiple of 9, 9..54customName- player-chosen display name, or null to use the default numbered titlecontainerData- encoded inventory bytes, or null if the chest has never been savedkind- whether this is a normal or a temporary (overflow) chestexpiresAt- epoch millis when this chest expires, or null if it never expiresicon- material key of the player-chosen icon, or null for the default icon
public record EnderChestData(UUID owner, int index, int size, @Nullable String customName, @org.jetbrains.annotations.Nullable byte[] containerData, ChestKind kind, @Nullable Long expiresAt, @Nullable String icon)
extends Record
A single ender chest belonging to a player, as loaded from storage for opening.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@org.jetbrains.annotations.Nullable byte[]Returns the value of thecontainerDatarecord component.@Nullable StringReturns the value of thecustomNamerecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable LongReturns the value of theexpiresAtrecord component.final inthashCode()Returns a hash code value for this object.@Nullable Stringicon()Returns the value of theiconrecord component.intindex()Returns the value of theindexrecord component.kind()Returns the value of thekindrecord component.owner()Returns the value of theownerrecord component.intsize()Returns the value of thesizerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EnderChestData
public EnderChestData(UUID owner, int index, int size, @Nullable @Nullable String customName, @Nullable @org.jetbrains.annotations.Nullable byte[] containerData, ChestKind kind, @Nullable @Nullable Long expiresAt, @Nullable @Nullable String icon) Creates an instance of aEnderChestDatarecord class.- Parameters:
owner- the value for theownerrecord componentindex- the value for theindexrecord componentsize- the value for thesizerecord componentcustomName- the value for thecustomNamerecord componentcontainerData- the value for thecontainerDatarecord componentkind- the value for thekindrecord componentexpiresAt- the value for theexpiresAtrecord componenticon- the value for theiconrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
owner
Returns the value of theownerrecord component.- Returns:
- the value of the
ownerrecord component
-
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-
size
public int size()Returns the value of thesizerecord component.- Returns:
- the value of the
sizerecord component
-
customName
Returns the value of thecustomNamerecord component.- Returns:
- the value of the
customNamerecord component
-
containerData
@Nullable public @org.jetbrains.annotations.Nullable byte[] containerData()Returns the value of thecontainerDatarecord component.- Returns:
- the value of the
containerDatarecord component
-
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
expiresAt
Returns the value of theexpiresAtrecord component.- Returns:
- the value of the
expiresAtrecord component
-
icon
Returns the value of theiconrecord component.- Returns:
- the value of the
iconrecord component
-