Class SingleArgumentProcessor<T>
- java.lang.Object
-
- me.hsgamer.bettergui.argument.type.BaseActionArgumentProcessor
-
- me.hsgamer.bettergui.argument.type.SingleArgumentProcessor<T>
-
- All Implemented Interfaces:
ArgumentProcessor,MenuElement
- Direct Known Subclasses:
DecimalArgumentProcessor,EntityTypeArgumentProcessor,MaterialArgumentProcessor,NumberArgumentProcessor,PlayerArgumentProcessor
public abstract class SingleArgumentProcessor<T> extends BaseActionArgumentProcessor
-
-
Field Summary
-
Fields inherited from class me.hsgamer.bettergui.argument.type.BaseActionArgumentProcessor
onInvalidActionApplier, onRequiredActionApplier, options
-
-
Constructor Summary
Constructors Constructor Description SingleArgumentProcessor(ArgumentProcessorBuilder.Input input)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract StringgetArgumentValue(T object)protected abstract Optional<T>getObject(String name)protected Optional<T>getObject(UUID uuid)protected abstract Stream<T>getObjectStream()StringgetValue(String query, UUID uuid)Get the valueprotected abstract StringgetValue(String query, UUID uuid, T object)Optional<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-
Methods inherited from class me.hsgamer.bettergui.argument.type.BaseActionArgumentProcessor
getMenu
-
-
-
-
Constructor Detail
-
SingleArgumentProcessor
public SingleArgumentProcessor(ArgumentProcessorBuilder.Input input)
-
-
Method Detail
-
process
public Optional<String[]> process(UUID uuid, String[] args)
Description copied from interface:ArgumentProcessorProcess the arguments- 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:ArgumentProcessorGet the value- 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:ArgumentProcessorGet the tab complete for the arguments- 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
-
-