23 package com.realtime.crossfire.jxclient.commands;
25 import java.util.Collection;
26 import java.util.Collections;
27 import java.util.Locale;
29 import java.util.TreeMap;
30 import org.jetbrains.annotations.NotNull;
31 import org.jetbrains.annotations.Nullable;
43 private final Map<String, Command>
commands =
new TreeMap<>();
50 if (
commands.put(command.getCommandName(), command) !=
null) {
51 throw new IllegalArgumentException(
"duplicate command: "+command.getCommandName());
61 return Collections.unmodifiableCollection(
commands.keySet());
71 return commands.get(commandName.toLowerCase(Locale.ENGLISH));