Made system commands case insensitive and reworked /dabr mechanism

This commit is contained in:
delvh
2020-08-01 21:40:20 +02:00
parent 56bb00cd32
commit c3dfedc642
2 changed files with 21 additions and 5 deletions

View File

@ -37,7 +37,9 @@ public final class SystemCommandsMap {
* @see SystemCommandsMap#isValidKey(String)
* @since Envoy Client v0.2-beta
*/
public void add(String command, SystemCommand systemCommand) { if (isValidKey(command)) systemCommands.put(command, systemCommand); }
public void add(String command, SystemCommand systemCommand) {
if (isValidKey(command)) systemCommands.put(command.toLowerCase(), systemCommand);
}
/**
* This method checks if the input String is a key in the map and returns the
@ -60,7 +62,7 @@ public final class SystemCommandsMap {
* @return the wrapped system command, if present
* @since Envoy Client v0.2-beta
*/
public Optional<SystemCommand> get(String input) { return Optional.ofNullable(systemCommands.get(getCommand(input))); }
public Optional<SystemCommand> get(String input) { return Optional.ofNullable(systemCommands.get(getCommand(input.toLowerCase()))); }
/**
* This method ensures that the "/" of a {@link SystemCommand} is stripped.<br>