Record Class BuiltMenu

java.lang.Object
java.lang.Record
dev.aurelium.slate.builder.BuiltMenu

public record BuiltMenu(Map<String,BuiltItem> items, Map<String,BuiltTemplate<?>> templates, Map<String,BuiltComponent<?>> components, Map<String,ItemReplacer> titleReplacers, ItemReplacer titleAnyReplacer, PageProvider pageProvider, PropertyProvider propertyProvider, ItemModifier fillItem, MenuListener openListener, MenuListener updateListener, Map<String,Object> defaultOptions) extends Record
  • Constructor Details

    • BuiltMenu

      public BuiltMenu(Map<String,BuiltItem> items, Map<String,BuiltTemplate<?>> templates, Map<String,BuiltComponent<?>> components, Map<String,ItemReplacer> titleReplacers, ItemReplacer titleAnyReplacer, PageProvider pageProvider, PropertyProvider propertyProvider, ItemModifier fillItem, MenuListener openListener, MenuListener updateListener, Map<String,Object> defaultOptions)
      Creates an instance of a BuiltMenu record class.
      Parameters:
      items - the value for the items record component
      templates - the value for the templates record component
      components - the value for the components record component
      titleReplacers - the value for the titleReplacers record component
      titleAnyReplacer - the value for the titleAnyReplacer record component
      pageProvider - the value for the pageProvider record component
      propertyProvider - the value for the propertyProvider record component
      fillItem - the value for the fillItem record component
      openListener - the value for the openListener record component
      updateListener - the value for the updateListener record component
      defaultOptions - the value for the defaultOptions record component
  • Method Details

    • createEmpty

      public static BuiltMenu createEmpty()
    • getTemplate

      public <T> BuiltTemplate<T> getTemplate(String name, Class<T> contextType)
    • getComponent

      public <T> BuiltComponent<T> getComponent(String name, Class<T> contextType)
    • applyTitleReplacers

      public String applyTitleReplacers(String input, Slate slate, org.bukkit.entity.Player player, ActiveMenu activeMenu)
    • 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.
    • items

      public Map<String,BuiltItem> items()
      Returns the value of the items record component.
      Returns:
      the value of the items record component
    • templates

      public Map<String,BuiltTemplate<?>> templates()
      Returns the value of the templates record component.
      Returns:
      the value of the templates record component
    • components

      public Map<String,BuiltComponent<?>> components()
      Returns the value of the components record component.
      Returns:
      the value of the components record component
    • titleReplacers

      public Map<String,ItemReplacer> titleReplacers()
      Returns the value of the titleReplacers record component.
      Returns:
      the value of the titleReplacers record component
    • titleAnyReplacer

      public ItemReplacer titleAnyReplacer()
      Returns the value of the titleAnyReplacer record component.
      Returns:
      the value of the titleAnyReplacer record component
    • pageProvider

      public PageProvider pageProvider()
      Returns the value of the pageProvider record component.
      Returns:
      the value of the pageProvider record component
    • propertyProvider

      public PropertyProvider propertyProvider()
      Returns the value of the propertyProvider record component.
      Returns:
      the value of the propertyProvider record component
    • fillItem

      public ItemModifier fillItem()
      Returns the value of the fillItem record component.
      Returns:
      the value of the fillItem record component
    • openListener

      public MenuListener openListener()
      Returns the value of the openListener record component.
      Returns:
      the value of the openListener record component
    • updateListener

      public MenuListener updateListener()
      Returns the value of the updateListener record component.
      Returns:
      the value of the updateListener record component
    • defaultOptions

      public Map<String,Object> defaultOptions()
      Returns the value of the defaultOptions record component.
      Returns:
      the value of the defaultOptions record component