Class LongParser
java.lang.Object
net.apartium.cocoabeans.commands.parsers.ArgumentParser<Long>
net.apartium.cocoabeans.commands.parsers.LongParser
- 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
ConstructorsConstructorDescriptionLongParser(int priority) Creates a new long parserLongParser(int priority, String keyword) Creates a new long parser -
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
-
LongParser
Creates a new long parser- Parameters:
priority- parser priority of which should be higher than others or lowerkeyword- parser keyword
-
LongParser
public LongParser(int priority) Creates a new long parser- Parameters:
priority- parser priority of which should be higher than others or lower
-
-
Method Details
-
parse
Description copied from class:ArgumentParserTries to parse next argument in the context- Specified by:
parsein classArgumentParser<Long>- 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<Long>- 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<Long>- Parameters:
processingContext- cmd processing context- Returns:
- tab completion result if success, otherwise empty option
-