Record Class ChestDialogs.DetailContext

java.lang.Object
java.lang.Record
com.enhancedechest.gui.dialog.ChestDialogs.DetailContext
Record Components:
owner - whose chest these operations target (the clicker for self, the target for admin)
ownerName - display name of owner, used for admin Back navigation (null for self)
self - true when the viewer owns these chests
canEdit - whether the appearance edits (rename / icon / sort) may be shown
canSetMain - whether "set as main" may be shown (owner-only, gated on the open permission)
canClear - whether the admin Clear button may be shown (gated on the clear permission)
sourceBlock - owning ender-chest block for the lid animation on Open (self, right-click), or null
locale - the viewer's client locale (owner or admin, whoever is looking at the dialog) — threaded into the icon picker so its search can match localized item names; see IconCatalog.search(String, Locale)
Enclosing class:
ChestDialogs

public static record ChestDialogs.DetailContext(UUID owner, @Nullable String ownerName, boolean self, boolean canEdit, boolean canSetMain, boolean canClear, @Nullable org.bukkit.Location sourceBlock, Locale locale) extends Record
The owner/permission context a per-chest detail dialog operates in. The same dialog serves the chest owner and an admin viewing someone else's chest (/ee view); this record carries everything that differs between those cases, so the dialog itself stays a single code path.

All storage mutations (rename, icon, sort, set-main) target owner, not the clicking viewer — that is how an admin edits another player's chest. self decides Open and Back routing (own list vs. the admin view list); canEdit gates the appearance edits (rename / icon / sort); canSetMain gates "set as main" (owner-only); canClear gates the admin Clear button.

  • Constructor Summary

    Constructors
    Constructor
    Description
    DetailContext(UUID owner, @Nullable String ownerName, boolean self, boolean canEdit, boolean canSetMain, boolean canClear, @Nullable org.bukkit.Location sourceBlock, Locale locale)
    Creates an instance of a DetailContext record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the canClear record component.
    boolean
    Returns the value of the canEdit record component.
    boolean
    Returns the value of the canSetMain record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the locale record component.
    Returns the value of the owner record component.
    @Nullable String
    Returns the value of the ownerName record component.
    boolean
    Returns the value of the self record component.
    @Nullable org.bukkit.Location
    Returns the value of the sourceBlock 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

    • DetailContext

      public DetailContext(UUID owner, @Nullable @Nullable String ownerName, boolean self, boolean canEdit, boolean canSetMain, boolean canClear, @Nullable @Nullable org.bukkit.Location sourceBlock, Locale locale)
      Creates an instance of a DetailContext record class.
      Parameters:
      owner - the value for the owner record component
      ownerName - the value for the ownerName record component
      self - the value for the self record component
      canEdit - the value for the canEdit record component
      canSetMain - the value for the canSetMain record component
      canClear - the value for the canClear record component
      sourceBlock - the value for the sourceBlock record component
      locale - the value for the locale 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
    • ownerName

      @Nullable public @Nullable String ownerName()
      Returns the value of the ownerName record component.
      Returns:
      the value of the ownerName record component
    • self

      public boolean self()
      Returns the value of the self record component.
      Returns:
      the value of the self record component
    • canEdit

      public boolean canEdit()
      Returns the value of the canEdit record component.
      Returns:
      the value of the canEdit record component
    • canSetMain

      public boolean canSetMain()
      Returns the value of the canSetMain record component.
      Returns:
      the value of the canSetMain record component
    • canClear

      public boolean canClear()
      Returns the value of the canClear record component.
      Returns:
      the value of the canClear record component
    • sourceBlock

      @Nullable public @Nullable org.bukkit.Location sourceBlock()
      Returns the value of the sourceBlock record component.
      Returns:
      the value of the sourceBlock record component
    • locale

      public Locale locale()
      Returns the value of the locale record component.
      Returns:
      the value of the locale record component