Interface AggregateParser<C,O>

Type Parameters:
C - the command sender type
O - the output type
All Superinterfaces:
ArgumentParser<C,O>, ArgumentParser.FutureArgumentParser<C,O>, ParserDescriptor<C,O>, SuggestionProviderHolder<C>

@API(status=STABLE) public interface AggregateParser<C,O> extends ArgumentParser.FutureArgumentParser<C,O>, ParserDescriptor<C,O>
An argument parser that delegates to multiple inner components() and transforms the aggregate results into an output using the mapper().

You may either implement this interface to create a new parser type, or create an aggregate parser by using a builder().

The parsers components() will be invoked in the order of the returned collection. When parsing, each parser will be invoked and the result will be stored in a AggregateParsingContext. After parsing, the mapper() will be invoked, turning the intermediate results into the output type which is then returned by this parser.

When evaluating the suggestions for this parser, some component parsers will be invoked, which allows the suggestion providers to rely on the results from the preceding components.