Record Class GuideDefinition

java.lang.Object
java.lang.Record
ke.ric.api.guide.GuideDefinition

public record GuideDefinition(String id, int order, Function<org.bukkit.entity.Player, org.bukkit.inventory.ItemStack> hubItem, Function<org.bukkit.entity.Player, GuidePage> page, String permission, BiFunction<org.bukkit.entity.Player, String, GuidePage> routes, GuideDefinition.PageResolver pages) extends Record
Immutable addon-owned data suppliers; only registration retains these callbacks.
  • Constructor Details

    • GuideDefinition

      public GuideDefinition(String id, int order, Function<org.bukkit.entity.Player, org.bukkit.inventory.ItemStack> hubItem, Function<org.bukkit.entity.Player, GuidePage> page, String permission, BiFunction<org.bukkit.entity.Player, String, GuidePage> routes)
    • GuideDefinition

      public GuideDefinition(String id, int order, Function<org.bukkit.entity.Player, org.bukkit.inventory.ItemStack> hubItem, String permission, GuideDefinition.PageResolver pages)
    • GuideDefinition

      public GuideDefinition(String id, int order, Function<org.bukkit.entity.Player, org.bukkit.inventory.ItemStack> hubItem, Function<org.bukkit.entity.Player, GuidePage> page)
    • GuideDefinition

      public GuideDefinition(String id, int order, Function<org.bukkit.entity.Player, org.bukkit.inventory.ItemStack> hubItem, String permission, BiFunction<org.bukkit.entity.Player, String, GuidePage> routes)
    • GuideDefinition

      public GuideDefinition(String id, int order, Function<org.bukkit.entity.Player, org.bukkit.inventory.ItemStack> hubItem, Function<org.bukkit.entity.Player, GuidePage> page, String permission, BiFunction<org.bukkit.entity.Player, String, GuidePage> routes, GuideDefinition.PageResolver pages)
      Creates an instance of a GuideDefinition record class.
      Parameters:
      id - the value for the id record component
      order - the value for the order record component
      hubItem - the value for the hubItem record component
      page - the value for the page record component
      permission - the value for the permission record component
      routes - the value for the routes record component
      pages - the value for the pages record component
  • Method Details

    • resolve

      public GuidePage resolve(org.bukkit.entity.Player player, String route)
    • resolve

      public GuidePage resolve(org.bukkit.entity.Player player, String route, GuidePageRequest request)
    • 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 the compare method from their corresponding wrapper classes.
      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

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • order

      public int order()
      Returns the value of the order record component.
      Returns:
      the value of the order record component
    • hubItem

      public Function<org.bukkit.entity.Player, org.bukkit.inventory.ItemStack> hubItem()
      Returns the value of the hubItem record component.
      Returns:
      the value of the hubItem record component
    • page

      public Function<org.bukkit.entity.Player, GuidePage> page()
      Returns the value of the page record component.
      Returns:
      the value of the page record component
    • permission

      public String permission()
      Returns the value of the permission record component.
      Returns:
      the value of the permission record component
    • routes

      public BiFunction<org.bukkit.entity.Player, String, GuidePage> routes()
      Returns the value of the routes record component.
      Returns:
      the value of the routes record component
    • pages

      Returns the value of the pages record component.
      Returns:
      the value of the pages record component