Enum Class Buttons

java.lang.Object
java.lang.Enum<Buttons>
com.ultikits.ultitools.entities.Buttons
All Implemented Interfaces:
Serializable, Comparable<Buttons>, java.lang.constant.Constable

public enum Buttons extends Enum<Buttons>
The enum Buttons.

Uses lazy initialization to avoid calling UltiTools.getInstance() during class loading, which allows for proper testing and prevents NullPointerException when the plugin is not initialized.

  • Enum Constant Details

    • PREVIOUS

      public static final Buttons PREVIOUS
      Previous buttons.
    • NEXT

      public static final Buttons NEXT
      Next buttons.
    • BACK

      public static final Buttons BACK
      Back buttons.
    • QUIT

      public static final Buttons QUIT
      Quit buttons.
    • OK

      public static final Buttons OK
      Ok buttons.
    • CANCEL

      public static final Buttons CANCEL
      Cancel buttons.
  • Field Details

    • nameKey

      private final String nameKey
      The i18n key for the button name.
    • itemStackSupplier

      private final Supplier<org.bukkit.inventory.ItemStack> itemStackSupplier
      The supplier for lazy initialization of ItemStack.
    • cachedName

      private String cachedName
      Cached translated name.
    • cachedItemStack

      private org.bukkit.inventory.ItemStack cachedItemStack
      Cached ItemStack.
  • Constructor Details

    • Buttons

      private Buttons(String nameKey, Supplier<org.bukkit.inventory.ItemStack> itemStackSupplier)
  • Method Details

    • values

      public static Buttons[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Buttons valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getName

      public String getName()
      Get name string.
      Returns:
      Button 's name 按钮名称
    • getItemStack

      public org.bukkit.inventory.ItemStack getItemStack()
      Get item stack item stack.
      Returns:
      Button 's material 按钮材质