@Test public void testNothingFound() { assertNull(consoleCommands.findCommand("testDirect")); }
@Nullable public ConsoleCommand findCommand(@Nonnull final String commandText) { ConsoleCommand command = commands.get(commandText); if (command != null) { return command; } List<String> commandMatches = findMatches(commandText); if (commandMatches.size() == 1) { return commands.get(commandMatches.get(0)); } return null; }
ConsoleCommands implements KeyInputHandler { @Nullable public ConsoleCommand findCommand(@Nonnull final String commandText) { ConsoleCommand command = commands.get(commandText); if (command != null) { return command; } List<String> commandMatches = findMatches(commandText); if (commandMatches.size() == 1) { return commands.get(commandMatches.get(0)); } return null; } }
ConsoleCommands implements KeyInputHandler { @Nullable public ConsoleCommand findCommand(@Nonnull final String commandText) { ConsoleCommand command = commands.get(commandText); if (command != null) { return command; } List<String> commandMatches = findMatches(commandText); if (commandMatches.size() == 1) { return commands.get(commandMatches.get(0)); } return null; } ConsoleCommands(@Nonnull final Nifty nifty, @Nonnull final Console console); }
ConsoleCommands implements KeyInputHandler { @Nullable public ConsoleCommand findCommand(@Nonnull final String commandText) { ConsoleCommand command = commands.get(commandText); if (command != null) { return command; } List<String> commandMatches = findMatches(commandText); if (commandMatches.size() == 1) { return commands.get(commandMatches.get(0)); } return null; } ConsoleCommands(@Nonnull final Nifty nifty, @Nonnull final Console console); void enableCommandCompletion(final boolean enabled); void registerCommand(@Nonnull final String commandText, @Nonnull final ConsoleCommand command); @Nonnull List<String> getRegisteredCommands(); @Override boolean keyEvent(@Nonnull final NiftyInputEvent inputEvent); @Nullable ConsoleCommand findCommand(@Nonnull final String commandText); }
ConsoleCommands implements KeyInputHandler { @Nullable public ConsoleCommand findCommand(@Nonnull final String commandText) { ConsoleCommand command = commands.get(commandText); if (command != null) { return command; } List<String> commandMatches = findMatches(commandText); if (commandMatches.size() == 1) { return commands.get(commandMatches.get(0)); } return null; } ConsoleCommands(@Nonnull final Nifty nifty, @Nonnull final Console console); void enableCommandCompletion(final boolean enabled); void registerCommand(@Nonnull final String commandText, @Nonnull final ConsoleCommand command); @Nonnull List<String> getRegisteredCommands(); @Override boolean keyEvent(@Nonnull final NiftyInputEvent inputEvent); @Nullable ConsoleCommand findCommand(@Nonnull final String commandText);  }