Package revxrsal.commands.process
Interface ContextResolver<T>
- Type Parameters:
T
- The resolved type
public interface ContextResolver<T>
A resolver for resolving values that are, by default, resolvable through the command
invocation context, and do not need any data from the arguments to find the value.
An example context resolver is finding the sender's world.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Represents the resolving context ofContextResolver
. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ContextResolver<T>
Returns a context resolver that returns a supplier value.static <T> ContextResolver<T>
of
(T value) Returns a context resolver that returns a static value.resolve
(@NotNull ContextResolver.ContextResolverContext context) Resolves the value of this resolver
-
Method Details
-
resolve
Resolves the value of this resolver- Parameters:
context
- The command resolving context.- Returns:
- The resolved value. May or may not be null.
- Throws:
Throwable
-
of
Returns a context resolver that returns a static value. This is a simpler way for adding constant values without having to deal with lambdas.- Type Parameters:
T
- The value type- Parameters:
value
- The value to return- Returns:
- The context resolver
- Since:
- 1.3.0
-
of
Returns a context resolver that returns a supplier value. This is a simpler way for adding values without having to deal with lambdas.- Type Parameters:
T
- The value type- Parameters:
value
- The value supplier- Returns:
- The context resolver
- Since:
- 1.3.0
-