Package me.hsgamer.bettergui.argument
Class ArgumentHandler
- java.lang.Object
-
- me.hsgamer.bettergui.argument.ArgumentHandler
-
- All Implemented Interfaces:
ArgumentProcessor
,MenuElement
public class ArgumentHandler extends Object implements ArgumentProcessor
The handler for arguments
-
-
Constructor Summary
Constructors Constructor Description ArgumentHandler(Menu menu, Map<String,Object> section)
Create a new handler
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Menu
getMenu()
Get the menu containing the elementString
getValue(String query, UUID uuid)
Get the valueList<String>
handleTabComplete(UUID uuid, String[] args)
Get the tab complete for the argumentsOptional<String[]>
process(UUID uuid, String[] args)
Process the argumentsPair<Optional<List<String>>,String[]>
tabComplete(UUID uuid, String[] args)
Get the tab complete for the arguments
-
-
-
Method Detail
-
process
public Optional<String[]> process(UUID uuid, String[] args)
Description copied from interface:ArgumentProcessor
Process the arguments- Specified by:
process
in interfaceArgumentProcessor
- Parameters:
uuid
- the UUID of the playerargs
- the arguments- Returns:
- the remaining arguments, or empty if the arguments are invalid
-
getValue
public String getValue(String query, UUID uuid)
Description copied from interface:ArgumentProcessor
Get the value- Specified by:
getValue
in interfaceArgumentProcessor
- Parameters:
query
- the queryuuid
- the UUID of the player- Returns:
- the value
-
tabComplete
public Pair<Optional<List<String>>,String[]> tabComplete(UUID uuid, String[] args)
Description copied from interface:ArgumentProcessor
Get the tab complete for the arguments- Specified by:
tabComplete
in interfaceArgumentProcessor
- Parameters:
uuid
- the UUID of the playerargs
- the arguments- Returns:
- A pair of the optional suggestions and the remaining arguments. The optional suggestions can be null if the processor should be skipped, then the remaining arguments will be used for the next processor
-
handleTabComplete
public List<String> handleTabComplete(UUID uuid, String[] args)
Get the tab complete for the arguments- Parameters:
uuid
- the UUID of the playerargs
- the arguments- Returns:
- the suggestions
-
getMenu
public Menu getMenu()
Description copied from interface:MenuElement
Get the menu containing the element- Specified by:
getMenu
in interfaceMenuElement
- Returns:
- the menu
-
-