Class MenuBuilder

java.lang.Object
net.tnemc.menu.core.builder.MenuBuilder

public class MenuBuilder extends Object
Builder class for creating instances of the Menu class.
Since:
1.5.0.0
Author:
creatorfromhell
See Also:
  • Field Details

  • Constructor Details

    • MenuBuilder

      public MenuBuilder(String name)
  • Method Details

    • withTitle

      public MenuBuilder withTitle(String title)
      Sets the title for the menu.
      Parameters:
      title - The title to be set for the menu.
      Returns:
      This MenuBuilder instance for method chaining.
    • withRows

      public MenuBuilder withRows(int rows)
      Sets the number of rows for the menu.
      Parameters:
      rows - The number of rows to be set for the menu.
      Returns:
      This MenuBuilder instance for method chaining.
    • withOpenCallback

      public MenuBuilder withOpenCallback(Consumer<MenuOpenCallback> open)
      Sets the open callback for the menu.
      Parameters:
      open - The open callback to be set for the menu.
      Returns:
      This MenuBuilder instance for method chaining.
    • withCloseCallback

      public MenuBuilder withCloseCallback(Consumer<MenuCloseCallback> close)
      Sets the close callback for the menu.
      Parameters:
      close - The close callback to be set for the menu.
      Returns:
      This MenuBuilder instance for method chaining.
    • withPages

      public MenuBuilder withPages(Page... pages)
      Adds pages to the menu using varargs.
      Parameters:
      pages - The pages to be added to the menu.
      Returns:
      This MenuBuilder instance for method chaining.
    • build

      public Menu build()
      Builds and returns the Menu instance based on the provided configuration.
      Returns:
      The constructed Menu instance.