Record Class ChestSummary

java.lang.Object
java.lang.Record
com.enhancedechest.model.ChestSummary
Record Components:
index - 1-based chest index
size - slot count (multiple of 9, 9..54)
customName - player-chosen name, or null for the default numbered title
primary - true if this is the chest that /ec and right-click open
kind - whether this is a normal or a temporary (overflow) chest
expiresAt - epoch millis when this chest expires, or null if it never expires (drives the static "time remaining" snapshot shown in the dialog)
icon - material key of the player-chosen icon (e.g. minecraft:diamond), or null for the default ender-chest icon; rendered next to the name in the list dialog as an Adventure sprite object component

public record ChestSummary(int index, int size, @Nullable String customName, boolean primary, ChestKind kind, @Nullable Long expiresAt, @Nullable String icon) extends Record
Lightweight description of one of a player's ender chests, used to build the /ec list management dialog and to decide which chest /ec opens.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ChestSummary(int index, int size, @Nullable String customName, boolean primary, ChestKind kind, @Nullable Long expiresAt, @Nullable String icon)
    Creates an instance of a ChestSummary record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @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.
    boolean
    Returns the value of the primary 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

    • ChestSummary

      public ChestSummary(int index, int size, @Nullable @Nullable String customName, boolean primary, ChestKind kind, @Nullable @Nullable Long expiresAt, @Nullable @Nullable String icon)
      Creates an instance of a ChestSummary record class.
      Parameters:
      index - the value for the index record component
      size - the value for the size record component
      customName - the value for the customName record component
      primary - the value for the primary 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.
    • 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
    • primary

      public boolean primary()
      Returns the value of the primary record component.
      Returns:
      the value of the primary 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