Interface Parser<T>

Type Parameters:
T - The type of object that parse(StringReader) returns.
All Known Subinterfaces:
ParserArgument<T>, ParserLiteral
All Known Implementing Classes:
ParserArgument.WithSuggestions, ParserLiteral.WithSuggestions
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Parser<T>
A FunctionalInterface that reads input from a StringReader and interprets it as an object.

Use parse(StringReader) or listSuggestions(CommandContext, SuggestionsBuilder) to process input.

Parsers can be directly defined by implementing the abstract method getResult(StringReader) method. They may also be defined with a slightly different interface by implementing ParserArgument.parse(StringReader) or parse(StringReader). If you are trying to define one of these using a lambda and Java needs extra hints to infer the lambda signature, you can use one of the following static methods: