Class CommandLine.AbstractParseResultHandler<R>

java.lang.Object
nz.org.riskscape.picocli.CommandLine.AbstractHandler<R,CommandLine.AbstractParseResultHandler<R>>
nz.org.riskscape.picocli.CommandLine.AbstractParseResultHandler<R>
All Implemented Interfaces:
CommandLine.IExecutionStrategy, CommandLine.IParseResultHandler2<R>
Direct Known Subclasses:
CommandLine.RunAll, CommandLine.RunFirst, CommandLine.RunLast
Enclosing class:
CommandLine

@Deprecated public abstract static class CommandLine.AbstractParseResultHandler<R> extends CommandLine.AbstractHandler<R,CommandLine.AbstractParseResultHandler<R>> implements CommandLine.IParseResultHandler2<R>, CommandLine.IExecutionStrategy
Command line parse result handler that returns a value. This handler prints help if requested, and otherwise calls handle(CommandLine.ParseResult) with the parse result. Facilitates implementation of the CommandLine.IParseResultHandler2 interface.

Note that AbstractParseResultHandler is a generic type. This, along with the abstract self method, allows method chaining to work properly in subclasses, without the need for casts. An example subclass can look like this:


 class MyResultHandler extends AbstractParseResultHandler<MyReturnType> {

     protected MyReturnType handle(ParseResult parseResult) throws ExecutionException { ... }

     protected MyResultHandler self() { return this; }
 }
 
Since:
3.0