co.aikar.commands

## Class CommandContexts<R extends CommandExecutionContext<?,? extends CommandIssuer>>

- java.lang.Object
- - co.aikar.commands.CommandContexts<R>

    public class CommandContexts<R extends CommandExecutionContext<?,? extends CommandIssuer>>
    extends Object

### Field Summary

Fields
`protected Map<Class<?>,ContextResolver<?,R>>` `contextMap`
`protected CommandManager` `manager`

### Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods
`ContextResolver<?,R>` `getResolver(Class<?> type)`
`<T> void` `registerContext(Class<T> context, ContextResolver<T,R> supplier)` Registers a context that requires input from the command issuer to resolve.
`<T> void` `registerIssuerAwareContext(Class<T> context, IssuerAwareContextResolver<T,R> supplier)` Registers a context resolver that may conditionally consume input, falling back to using the context of the issuer to potentially fulfill this context.
`<T> void` `registerIssuerOnlyContext(Class<T> context, IssuerOnlyContextResolver<T,R> supplier)` Registers a context resolver that will never consume input.
`<T> void` `registerOptionalContext(Class<T> context, OptionalContextResolver<T,R> supplier)` Registers a context that can safely accept a null input from the command issuer to resolve.
`<T> void` `registerSenderAwareContext(Class<T> context, IssuerAwareContextResolver<T,R> supplier)` Deprecated. Please switch to `registerIssuerAwareContext(Class, IssuerAwareContextResolver)` as the core wants to use the platform agnostic term of "Issuer" instead of Sender

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### contextMap

    protected final Map<Class<?>,ContextResolver<?,R extends CommandExecutionContext<?,? extends CommandIssuer>>> contextMap

#### manager

    protected final CommandManager manager

### Method Detail

#### registerSenderAwareContext

    @Deprecated
    public <T> void registerSenderAwareContext(Class<T> context,
                                                           IssuerAwareContextResolver<T,R> supplier)

Deprecated. Please switch to `registerIssuerAwareContext(Class, IssuerAwareContextResolver)` as the core wants to use the platform agnostic term of "Issuer" instead of Sender

See Also:
  `registerIssuerAwareContext(Class, IssuerAwareContextResolver)`

#### registerIssuerAwareContext

    public <T> void registerIssuerAwareContext(Class<T> context,
                                               IssuerAwareContextResolver<T,R> supplier)

Registers a context resolver that may conditionally consume input, falling back to using the context of the issuer to potentially fulfill this context. You may call `CommandExecutionContext.getFirstArg()` and then conditionally call `CommandExecutionContext.popFirstArg()` if you want to consume that input.

#### registerIssuerOnlyContext

    public <T> void registerIssuerOnlyContext(Class<T> context,
                                              IssuerOnlyContextResolver<T,R> supplier)

Registers a context resolver that will never consume input. It will always satisfy its context based on the issuer of the command, so it will not appear in syntax strings.

#### registerOptionalContext

    public <T> void registerOptionalContext(Class<T> context,
                                            OptionalContextResolver<T,R> supplier)

Registers a context that can safely accept a null input from the command issuer to resolve. This resolver should always call `CommandExecutionContext.popFirstArg()`

#### registerContext

    public <T> void registerContext(Class<T> context,
                                    ContextResolver<T,R> supplier)

Registers a context that requires input from the command issuer to resolve. This resolver should always call `CommandExecutionContext.popFirstArg()`

#### getResolver

    public ContextResolver<?,R> getResolver(Class<?> type)