Interface ArgumentTypeLookup<S extends CommandSource>
- Type Parameters:
S- the source type
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Functional interface for resolving nested/component types during argument type resolution.
This interface is passed to ArgumentTypeHandlers to allow them to recursively
resolve ArgumentType instances for nested generic type parameters.
-
Method Summary
Modifier and TypeMethodDescription<T> @NotNull Optional<ArgumentType<S,T>> Looks up anArgumentTypefor the specified type.default <T> @NotNull ArgumentType<S,T> lookupOrThrow(@NotNull Type type) Looks up anArgumentTypefor the specified type, throwing an exception if not found.
-
Method Details
-
lookup
Looks up anArgumentTypefor the specified type.- Type Parameters:
T- the resolved type- Parameters:
type- the type to look up- Returns:
- an optional containing the ArgumentType if found, empty otherwise
-
lookupOrThrow
Looks up anArgumentTypefor the specified type, throwing an exception if not found.- Type Parameters:
T- the resolved type- Parameters:
type- the type to look up- Returns:
- the resolved ArgumentType
- Throws:
IllegalArgumentException- if the type cannot be resolved
-