Record Class IconCatalog.Entry

java.lang.Object
java.lang.Record
com.enhancedechest.gui.dialog.IconCatalog.Entry
Enclosing class:
IconCatalog

public static record IconCatalog.Entry(org.bukkit.Material material, String key, String displayName, String lowerName, net.kyori.adventure.text.Component sprite, net.kyori.adventure.text.Component name) extends Record
One pickable icon: a material with its precomputed display name, reusable sprite component, and a translatable name component. displayName/lowerName are a server-derived English name used only for search matching (the server can't know what text a translation key resolves to client-side); name is what's actually shown to the player — a Component.translatable that the Minecraft client resolves using its own language file, so it renders in the viewer's client-side language exactly like the item's name in an inventory tooltip.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Entry(org.bukkit.Material material, String key, String displayName, String lowerName, net.kyori.adventure.text.Component sprite, net.kyori.adventure.text.Component name)
    Creates an instance of a Entry record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the displayName record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    key()
    Returns the value of the key record component.
    Returns the value of the lowerName record component.
    org.bukkit.Material
    Returns the value of the material record component.
    net.kyori.adventure.text.Component
    Returns the value of the name record component.
    net.kyori.adventure.text.Component
    Returns the value of the sprite 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

    • Entry

      public Entry(org.bukkit.Material material, String key, String displayName, String lowerName, net.kyori.adventure.text.Component sprite, net.kyori.adventure.text.Component name)
      Creates an instance of a Entry record class.
      Parameters:
      material - the value for the material record component
      key - the value for the key record component
      displayName - the value for the displayName record component
      lowerName - the value for the lowerName record component
      sprite - the value for the sprite record component
      name - the value for the name 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • material

      public org.bukkit.Material material()
      Returns the value of the material record component.
      Returns:
      the value of the material record component
    • key

      public String key()
      Returns the value of the key record component.
      Returns:
      the value of the key record component
    • displayName

      public String displayName()
      Returns the value of the displayName record component.
      Returns:
      the value of the displayName record component
    • lowerName

      public String lowerName()
      Returns the value of the lowerName record component.
      Returns:
      the value of the lowerName record component
    • sprite

      public net.kyori.adventure.text.Component sprite()
      Returns the value of the sprite record component.
      Returns:
      the value of the sprite record component
    • name

      public net.kyori.adventure.text.Component name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component