co.aikar.commands

## Class CommandCompletions<C extends CommandCompletionContext>

- java.lang.Object
- - co.aikar.commands.CommandCompletions<C>

    public class CommandCompletions<C extends CommandCompletionContext>
    extends Object

### Nested Class Summary

Nested Classes
`static interface` `CommandCompletions.AsyncCommandCompletionHandler<C extends CommandCompletionContext>`
`static interface` `CommandCompletions.CommandCompletionHandler<C extends CommandCompletionContext>`
`static class` `CommandCompletions.SyncCompletionRequired`

### Constructor Summary

Constructors
Constructor and Description
`CommandCompletions(CommandManager manager)`

### Method Summary

All Methods Instance Methods Concrete Methods
`CommandCompletions.CommandCompletionHandler` `registerAsyncCompletion(String id, CommandCompletions.AsyncCommandCompletionHandler<C> handler)` Registr a completion handler to provide command completions based on the user input.
`CommandCompletions.CommandCompletionHandler` `registerCompletion(String id, CommandCompletions.CommandCompletionHandler<C> handler)` Registr a completion handler to provide command completions based on the user input.
`CommandCompletions.CommandCompletionHandler` `registerStaticCompletion(String id, Collection<String> completions)` Register a static list of command completions that will never change
`CommandCompletions.CommandCompletionHandler` `registerStaticCompletion(String id, String list)` Register a static list of command completions that will never change.
`CommandCompletions.CommandCompletionHandler` `registerStaticCompletion(String id, String[] completions)` Register a static list of command completions that will never change
`CommandCompletions.CommandCompletionHandler` `registerStaticCompletion(String id, Supplier<Collection<String>> supplier)` Register a static list of command completions that will never change.

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

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

### Constructor Detail

#### CommandCompletions

    public CommandCompletions(CommandManager manager)

### Method Detail

#### registerCompletion

    public CommandCompletions.CommandCompletionHandler registerCompletion(String id,
                                                                          CommandCompletions.CommandCompletionHandler<C> handler)

Registr a completion handler to provide command completions based on the user input.

Parameters:
  `id` -
  `handler` -
Returns:

#### registerAsyncCompletion

    public CommandCompletions.CommandCompletionHandler registerAsyncCompletion(String id,
                                                                               CommandCompletions.AsyncCommandCompletionHandler<C> handler)

Registr a completion handler to provide command completions based on the user input. This handler is declared to be safe to be executed asynchronously.

Not all platforms support this, so if the platform does not support asynchronous execution, your handler will be executed on the main thread.

Use this anytime your handler does not need to access state that is not considered thread safe.

Use context.isAsync() to determine if you are async or not.

Parameters:
  `id` -
  `handler` -
Returns:

#### registerStaticCompletion

    public CommandCompletions.CommandCompletionHandler registerStaticCompletion(String id,
                                                                                String list)

Register a static list of command completions that will never change. Like @CommandCompletion, values are | (PIPE) separated.

Example: foo|bar|baz

Parameters:
  `id` -
  `list` -
Returns:

#### registerStaticCompletion

    public CommandCompletions.CommandCompletionHandler registerStaticCompletion(String id,
                                                                                String[] completions)

Register a static list of command completions that will never change

Parameters:
  `id` -
  `completions` -
Returns:

#### registerStaticCompletion

    public CommandCompletions.CommandCompletionHandler registerStaticCompletion(String id,
                                                                                Supplier<Collection<String>> supplier)

Register a static list of command completions that will never change. The list is obtained from the supplier immediately as part of this method call.

Parameters:
  `id` -
  `supplier` -
Returns:

#### registerStaticCompletion

    public CommandCompletions.CommandCompletionHandler registerStaticCompletion(String id,
                                                                                Collection<String> completions)

Register a static list of command completions that will never change

Parameters:
  `id` -
  `completions` -
Returns: