Package net.tnemc.menu.core.builder
Class MenuBuilder
java.lang.Object
net.tnemc.menu.core.builder.MenuBuilder
Builder class for creating instances of the
Menu
class.- Since:
- 1.5.0.0
- Author:
- creatorfromhell
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds and returns theMenu
instance based on the provided configuration.Sets the close callback for the menu.Sets the open callback for the menu.Adds pages to the menu using varargs.withRows
(int rows) Sets the number of rows for the menu.Sets the title for the menu.
-
Field Details
-
pages
-
name
-
title
-
rows
private int rows -
open
-
close
-
-
Constructor Details
-
MenuBuilder
-
-
Method Details
-
withTitle
Sets the title for the menu.- Parameters:
title
- The title to be set for the menu.- Returns:
- This
MenuBuilder
instance for method chaining.
-
withRows
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
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
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.
-
build
Builds and returns theMenu
instance based on the provided configuration.- Returns:
- The constructed
Menu
instance.
-