Package baritone.api.command.argparser
Interface IArgParserManager
public interface IArgParserManager
Used to retrieve
IArgParser instances from the registry, by their target class.
It can be assumed that a IArgParser exists for Integer, Long,
Float, Double and Boolean.- Since:
- 10/4/2019
- Author:
- Brady
-
Method Summary
Modifier and TypeMethodDescription<T,S> IArgParser.Stated <T, S> getParserStated(Class<T> type, Class<S> stateKlass) <T> IArgParser.Stateless<T> getParserStateless(Class<T> type) <T,S> T parseStated(Class<T> type, Class<S> stateKlass, ICommandArgument arg, S state) Attempt to parse the specified argument with a statedIArgParserthat outputs the specified class.<T> TparseStateless(Class<T> type, ICommandArgument arg) Attempt to parse the specified argument with a statelessIArgParserthat outputs the specified class.
-
Method Details
-
getParserStateless
- Parameters:
type- The type trying to be parsed- Returns:
- A parser that can parse arguments into this class, if found.
-
getParserStated
- Parameters:
type- The type trying to be parsed- Returns:
- A parser that can parse arguments into this class, if found.
-
parseStateless
Attempt to parse the specified argument with a statelessIArgParserthat outputs the specified class.- Parameters:
type- The type to try and parse the argument into.arg- The argument to parse.- Returns:
- An instance of the specified class.
- Throws:
CommandInvalidTypeException- If the parsing failed
-
parseStated
<T,S> T parseStated(Class<T> type, Class<S> stateKlass, ICommandArgument arg, S state) throws CommandInvalidTypeException Attempt to parse the specified argument with a statedIArgParserthat outputs the specified class.- Parameters:
type- The type to try and parse the argument into.arg- The argument to parse.state- The state to pass to theIArgParser.Stated.- Returns:
- An instance of the specified class.
- Throws:
CommandInvalidTypeException- If the parsing failed- See Also:
-
getRegistry
-