Class ParseResult<T>
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 statebooleanIndicates 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
-
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
nullif no command was parsed
-