Record Class GliderDefinition

java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.glider.GliderDefinition
Record Components:
id - the stable ID cosmetics ownership is stored under
name - the display name, in Zentrix's colour format
lore - the description lines, in Zentrix's colour format
permission - the permission granted to players who own it, or null for none
item - the item worn on the player's back while gliding, as resolved now; a copy

public record GliderDefinition(@NotNull String id, @NotNull String name, @NotNull List<String> lore, @Nullable String permission, @NotNull org.bukkit.inventory.ItemStack item) extends Record
One glider of the catalog in content/cosmetics/gliders.yml. A snapshot: later edits in the glider editor do not change it.
Since:
1.8.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    GliderDefinition(@NotNull String id, @NotNull String name, @NotNull List<String> lore, @Nullable String permission, @NotNull org.bukkit.inventory.ItemStack item)
    Creates an instance of a GliderDefinition record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    @NotNull Optional<String>
    The permission granted to owners, when there is one.
    final int
    Returns a hash code value for this object.
    @NotNull String
    id()
    Returns the value of the id record component.
    @NotNull org.bukkit.inventory.ItemStack
    A copy of the item worn on the player's back.
    @NotNull List<String>
    Returns the value of the lore record component.
    @NotNull String
    Returns the value of the name record component.
    @Nullable String
    Returns the value of the permission 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

    • GliderDefinition

      public GliderDefinition(@NotNull @NotNull String id, @NotNull @NotNull String name, @NotNull @NotNull List<String> lore, @Nullable @Nullable String permission, @NotNull @NotNull org.bukkit.inventory.ItemStack item)
      Creates an instance of a GliderDefinition record class.
      Parameters:
      id - the value for the id record component
      name - the value for the name record component
      lore - the value for the lore record component
      permission - the value for the permission record component
      item - the value for the item record component
  • Method Details

    • getPermission

      @NotNull public @NotNull Optional<String> getPermission()
      The permission granted to owners, when there is one.
    • item

      @NotNull public @NotNull org.bukkit.inventory.ItemStack item()
      A copy of the item worn on the player's back.
    • 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.
    • id

      @NotNull public @NotNull String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • name

      @NotNull public @NotNull String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • lore

      @NotNull public @NotNull List<String> lore()
      Returns the value of the lore record component.
      Returns:
      the value of the lore record component
    • permission

      @Nullable public @Nullable String permission()
      Returns the value of the permission record component.
      Returns:
      the value of the permission record component