Class BooleanParser
java.lang.Object
net.apartium.cocoabeans.commands.parsers.ArgumentParser<Boolean>
net.apartium.cocoabeans.commands.parsers.BooleanParser
- All Implemented Interfaces:
Comparable<ArgumentParser<?>>
-
Nested Class Summary
Nested classes/interfaces inherited from class net.apartium.cocoabeans.commands.parsers.ArgumentParser
ArgumentParser.ParseResult<T>, ArgumentParser.TabCompletionResult -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBooleanParser(int priority) Creates a new boolean parserBooleanParser(int priority, String keyword) Creates a new boolean parserBooleanParser(int priority, String keyword, @NotNull Set<String> trueSet, @NotNull Set<String> falseSet) -
Method Summary
Modifier and TypeMethodDescriptionparse(CommandProcessingContext processingContext) Tries to parse next argument in the contexttabCompletion(CommandProcessingContext processingContext) Retrieves available options for tab completion of this argumenttryParse(CommandProcessingContext processingContext) Tries to lazily parse next argument in the contextMethods inherited from class net.apartium.cocoabeans.commands.parsers.ArgumentParser
compareTo, getArgumentType, getKeyword, getPriority
-
Field Details
-
DEFAULT_KEYWORD
- See Also:
-
-
Constructor Details
-
BooleanParser
public BooleanParser(int priority) Creates a new boolean parser- Parameters:
priority- parser priority of which should be higher than others or lower
-
BooleanParser
Creates a new boolean parser- Parameters:
priority- parser priority of which should be higher than others or lowerkeyword- parser keyword
-
BooleanParser
-
-
Method Details
-
parse
public Optional<ArgumentParser.ParseResult<Boolean>> parse(CommandProcessingContext processingContext) Description copied from class:ArgumentParserTries to parse next argument in the context- Specified by:
parsein classArgumentParser<Boolean>- Parameters:
processingContext- cmd processing context- Returns:
- empty if failed, otherwise result
-
tryParse
Description copied from class:ArgumentParserTries to lazily parse next argument in the context- Specified by:
tryParsein classArgumentParser<Boolean>- Parameters:
processingContext- cmd processing context- Returns:
- new index int if success, empty if not
-
tabCompletion
public Optional<ArgumentParser.TabCompletionResult> tabCompletion(CommandProcessingContext processingContext) Description copied from class:ArgumentParserRetrieves available options for tab completion of this argument- Specified by:
tabCompletionin classArgumentParser<Boolean>- Parameters:
processingContext- cmd processing context- Returns:
- tab completion result if success, otherwise empty option
-