Record Class EnderChestData

java.lang.Object
java.lang.Record
com.enhancedechest.model.EnderChestData
Record Components:
owner - the owning player
index - 1-based chest index (also drives the default "Ender Chest N" title)
size - slot count — always a multiple of 9, 9..54
customName - player-chosen display name, or null to use the default numbered title
containerData - encoded inventory bytes, or null if the chest has never been saved
kind - whether this is a normal or a temporary (overflow) chest
expiresAt - epoch millis when this chest expires, or null if it never expires
icon - 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
    Constructor
    Description
    EnderChestData(UUID owner, int index, int size, @Nullable String customName, @org.jetbrains.annotations.Nullable byte[] containerData, ChestKind kind, @Nullable Long expiresAt, @Nullable String icon)
    Creates an instance of a EnderChestData record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @org.jetbrains.annotations.Nullable byte[]
    Returns the value of the containerData record component.
    @Nullable String
    Returns the value of the customName record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    @Nullable Long
    Returns the value of the expiresAt record component.
    final int
    Returns a hash code value for this object.
    @Nullable String
    Returns the value of the icon record component.
    int
    Returns the value of the index record component.
    Returns the value of the kind record component.
    Returns the value of the owner record component.
    int
    Returns the value of the size record component.
    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

    • 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 a EnderChestData record class.
      Parameters:
      owner - the value for the owner record component
      index - the value for the index record component
      size - the value for the size record component
      customName - the value for the customName record component
      containerData - the value for the containerData record component
      kind - the value for the kind record component
      expiresAt - the value for the expiresAt record component
      icon - the value for the icon record component
  • Method Details

    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
      Returns:
      the value of the owner record component
    • index

      public int index()
      Returns the value of the index record component.
      Returns:
      the value of the index record component
    • size

      public int size()
      Returns the value of the size record component.
      Returns:
      the value of the size record component
    • customName

      @Nullable public @Nullable String customName()
      Returns the value of the customName record component.
      Returns:
      the value of the customName record component
    • containerData

      @Nullable public @org.jetbrains.annotations.Nullable byte[] containerData()
      Returns the value of the containerData record component.
      Returns:
      the value of the containerData record component
    • kind

      public ChestKind kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • expiresAt

      @Nullable public @Nullable Long expiresAt()
      Returns the value of the expiresAt record component.
      Returns:
      the value of the expiresAt record component
    • icon

      @Nullable public @Nullable String icon()
      Returns the value of the icon record component.
      Returns:
      the value of the icon record component