Class GUICommandFactoryImpl

java.lang.Object
com.realtime.crossfire.jxclient.gui.textinput.GUICommandFactoryImpl
All Implemented Interfaces:
GUICommandFactory

public class GUICommandFactoryImpl extends Object implements GUICommandFactory
Factory for creating GUICommand instances from string representation.
  • Constructor Details

    • GUICommandFactoryImpl

      public GUICommandFactoryImpl(@NotNull @NotNull CommandCallback commandCallback, @NotNull @NotNull CommandExecutor commandExecutor, @NotNull @NotNull Macros macros)
      Creates a new instance.
      Parameters:
      commandCallback - the command callback to use
      commandExecutor - the command executor instance to use
      macros - the macros instance to use
  • Method Details

    • createCommandDecode

      public GUICommand createCommandDecode(@NotNull @NotNull String encodedCommandString)
      Creates a new GUICommand instance from string representation.
      Specified by:
      createCommandDecode in interface GUICommandFactory
      Parameters:
      encodedCommandString - the command string representation
      Returns:
      the new command instance
    • createCommand

      @NotNull public @NotNull GUICommand createCommand(@NotNull @NotNull String commandString)
      Creates a new GUICommand instance from string representation.
      Specified by:
      createCommand in interface GUICommandFactory
      Parameters:
      commandString - the command string representation
      Returns:
      the new command instance
    • encode

      @NotNull public @NotNull String encode(@NotNull @NotNull String command)
      Encodes a key binding if necessary.
      Specified by:
      encode in interface GUICommandFactory
      Parameters:
      command - the key binding
      Returns:
      the encoded key binding
    • decode

      @NotNull public @NotNull String decode(@NotNull @NotNull String command)
      Decodes a key binding if necessary.
      Specified by:
      decode in interface GUICommandFactory
      Parameters:
      command - the key binding
      Returns:
      the decoded key binding