java.lang.Object
com.github.rvesse.airline.parser.ParseResult<T>
- Type Parameters:
T
- Command type
Represents parsing results
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Collection
<ParseException> private final ParseState
<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the command if one was successfully parsedGets the collection of errors that occurred, may be empty if parsing was successfulgetState()
Gets the final parser stateboolean
Indicates whether parsing was successful
-
Field Details
-
state
-
errors
-
-
Constructor Details
-
ParseResult
-
-
Method Details
-
wasSuccessful
public boolean wasSuccessful()Indicates whether parsing was successful- Returns:
- True if successful, false if any errors occurred
-
getState
Gets the final parser state- Returns:
- Parser state
-
getErrors
Gets the collection of errors that occurred, may be empty if parsing was successful- Returns:
- Errors
-
getCommand
Gets the command if one was successfully parsedNote that a command may have been parsed even when errors have been detected and handled by the error handler. Therefore you should check
wasSuccessful()
and act accordingly before assuming that it is safe to run the parsed command.- Returns:
- Command, or
null
if no command was parsed
-