22 package com.realtime.crossfire.jxclient.commands;
24 import java.util.HashMap;
26 import org.jetbrains.annotations.NotNull;
27 import org.jetbrains.annotations.Nullable;
39 private final Map<String, Command>
commands =
new HashMap<>();
46 if (commands.put(command.getCommandName(), command) != null) {
47 throw new IllegalArgumentException(
"duplicate command: "+command.getCommandName());
58 return commands.get(commandName.toLowerCase());
Implements a client-side command.
Command findCommand(@NotNull final String commandName)
Returns a Command by name.
final Map< String, Command > commands
Maps command name to Command instance.
void addCommand(@NotNull final Command command)
Adds an executable Command.
Parses and executes client-side commands.