| Package | Description |
|---|---|
| me.lucko.helper.command.argument |
| Modifier and Type | Method and Description |
|---|---|
static <T> ArgumentParser<T> |
ArgumentParser.of(Function<String,Optional<T>> parseFunction) |
static <T> ArgumentParser<T> |
ArgumentParser.of(Function<String,Optional<T>> parseFunction,
Function<String,CommandInterruptException> generateExceptionFunction) |
default ArgumentParser<T> |
ArgumentParser.thenTry(ArgumentParser<T> other)
Creates a new parser which first tries to obtain a value from
this parser, then from another if the former was not successful.
|
| Modifier and Type | Method and Description |
|---|---|
default <T> Optional<ArgumentParser<T>> |
ArgumentParserRegistry.find(Class<T> clazz)
Tries to find an argument parser for the given class
|
<T> Optional<ArgumentParser<T>> |
SimpleParserRegistry.find(TypeToken<T> type) |
<T> Optional<ArgumentParser<T>> |
ArgumentParserRegistry.find(TypeToken<T> type)
Tries to find an argument parser for the given type
|
default <T> Collection<ArgumentParser<T>> |
ArgumentParserRegistry.findAll(Class<T> clazz)
Finds all known parsers for a given class
|
<T> Collection<ArgumentParser<T>> |
SimpleParserRegistry.findAll(TypeToken<T> type) |
<T> Collection<ArgumentParser<T>> |
ArgumentParserRegistry.findAll(TypeToken<T> type)
Finds all known parsers for a given type
|
| Modifier and Type | Method and Description |
|---|---|
default <T> Optional<T> |
Argument.parse(ArgumentParser<T> parser) |
default <T> T |
Argument.parseOrFail(ArgumentParser<T> parser) |
default <T> void |
ArgumentParserRegistry.register(Class<T> clazz,
ArgumentParser<T> parser)
Registers a new parser with the registry
|
<T> void |
SimpleParserRegistry.register(TypeToken<T> type,
ArgumentParser<T> parser) |
<T> void |
ArgumentParserRegistry.register(TypeToken<T> type,
ArgumentParser<T> parser)
Registers a new parser with the registry
|
default ArgumentParser<T> |
ArgumentParser.thenTry(ArgumentParser<T> other)
Creates a new parser which first tries to obtain a value from
this parser, then from another if the former was not successful.
|
Copyright © 2020. All rights reserved.