Package com.enhancedechest.gui.dialog
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 ofowner, used for admin Back navigation (null for self)self- true when the viewer owns these chestscanEdit- whether the appearance edits (rename / icon / sort) may be showncanSetMain- 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 nulllocale- 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; seeIconCatalog.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
ConstructorsConstructorDescriptionDetailContext(UUID owner, @Nullable String ownerName, boolean self, boolean canEdit, boolean canSetMain, boolean canClear, @Nullable org.bukkit.Location sourceBlock, Locale locale) Creates an instance of aDetailContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanClear()Returns the value of thecanClearrecord component.booleancanEdit()Returns the value of thecanEditrecord component.booleanReturns the value of thecanSetMainrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.locale()Returns the value of thelocalerecord component.owner()Returns the value of theownerrecord component.@Nullable StringReturns the value of theownerNamerecord component.booleanself()Returns the value of theselfrecord component.@Nullable org.bukkit.LocationReturns the value of thesourceBlockrecord component.final StringtoString()Returns a string representation of this record class.
-
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 aDetailContextrecord class.- Parameters:
owner- the value for theownerrecord componentownerName- the value for theownerNamerecord componentself- the value for theselfrecord componentcanEdit- the value for thecanEditrecord componentcanSetMain- the value for thecanSetMainrecord componentcanClear- the value for thecanClearrecord componentsourceBlock- the value for thesourceBlockrecord componentlocale- the value for thelocalerecord 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
-
ownerName
Returns the value of theownerNamerecord component.- Returns:
- the value of the
ownerNamerecord component
-
self
public boolean self()Returns the value of theselfrecord component.- Returns:
- the value of the
selfrecord component
-
canEdit
public boolean canEdit()Returns the value of thecanEditrecord component.- Returns:
- the value of the
canEditrecord component
-
canSetMain
public boolean canSetMain()Returns the value of thecanSetMainrecord component.- Returns:
- the value of the
canSetMainrecord component
-
canClear
public boolean canClear()Returns the value of thecanClearrecord component.- Returns:
- the value of the
canClearrecord component
-
sourceBlock
@Nullable public @Nullable org.bukkit.Location sourceBlock()Returns the value of thesourceBlockrecord component.- Returns:
- the value of the
sourceBlockrecord component
-
locale
Returns the value of thelocalerecord component.- Returns:
- the value of the
localerecord component
-