Class WrappedArgumentParser<T>
java.lang.Object
net.apartium.cocoabeans.commands.parsers.ArgumentParser<T>
net.apartium.cocoabeans.commands.parsers.WrappedArgumentParser<T>
- Type Parameters:
T-
- 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 -
Constructor Summary
ConstructorsConstructorDescriptionWrappedArgumentParser(ArgumentParser<T> parser, int priority) Wrapped argument parser constructorWrappedArgumentParser(ArgumentParser<T> parser, int priority, String keyword) Wrapped argument parser constructorWrappedArgumentParser(ArgumentParser<T> parser, String keyword) Wrapped argument parser constructor -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()parse(CommandProcessingContext processingContext) Tries to parse next argument in the contexttabCompletion(CommandProcessingContext processingContext) Retrieves available options for tab completion of this argumenttoString()tryParse(CommandProcessingContext processingContext) Tries to lazily parse next argument in the contextMethods inherited from class net.apartium.cocoabeans.commands.parsers.ArgumentParser
compareTo, getArgumentType, getKeyword, getPriority
-
Constructor Details
-
WrappedArgumentParser
Wrapped argument parser constructor- Parameters:
parser- the argument parser to wrappriority- parser prioritykeyword- new keyword for the parser
-
WrappedArgumentParser
Wrapped argument parser constructor- Parameters:
parser- the argument parser to wrapkeyword- new keyword for the parser
-
WrappedArgumentParser
Wrapped argument parser constructor- Parameters:
parser- the argument parser to wrappriority- parser priority
-
-
Method Details
-
tabCompletion
public Optional<ArgumentParser.TabCompletionResult> tabCompletion(CommandProcessingContext processingContext) Retrieves available options for tab completion of this argument Using the wrapped parser to get tab completion- Specified by:
tabCompletionin classArgumentParser<T>- Parameters:
processingContext- cmd processing context- Returns:
- tab completion result if success, otherwise empty option
-
parse
Tries to parse next argument in the context Using the wrapped parser to parse the context- Specified by:
parsein classArgumentParser<T>- Parameters:
processingContext- cmd processing context- Returns:
- empty if failed, otherwise result
-
tryParse
Tries to lazily parse next argument in the context Using the wrapped parser to try parse the context- Specified by:
tryParsein classArgumentParser<T>- Parameters:
processingContext- cmd processing context- Returns:
- new index int if success, empty if not
-
equals
-
hashCode
public int hashCode() -
toString
-