# CommandContexts (ACF (Core) 0.5.1-SNAPSHOT API)
declaration: package: co.aikar.commands, class: CommandContexts

Package 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
Modifier and Type
Field
Description
`protected final Map<Class<?>,ContextResolver<?,R>>`
`contextMap`
`protected final CommandManager`
`manager`

## Method Summary

Modifier and Type
Method
Description
`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 Details

### contextMap

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

### manager

protected final CommandManager manager

## Method Details

### 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)