Class CommandFactory.UserCommandInfo

Object
UserCommandInfo
Enclosing class:
CommandFactory

public static class CommandFactory.UserCommandInfo extends Object
The definition of a user command. Bear in mind that commands that are executed often do not make very good global user commands, as the load on the database might be a little too much.
Author:
maartenl
  • Constructor Details

    • UserCommandInfo

      public UserCommandInfo(int aCommandId, String aCommand, String aMethodName, Long aRoom)
      constructor for creating a user command for a specific room.
      Parameters:
      aCommandId - the identification number for the command
      aCommand - the regular expression for determining the command is equal to the command entered.
      aMethodName - the name of the method to call.
      aRoom - the room in which this command is active. Can be a null pointer if the command is active in all rooms.
    • UserCommandInfo

      public UserCommandInfo(int aCommandId, String aCommand, String aMethodName)
      constructor for creating a user command for all rooms.
      Parameters:
      aCommandId - the identification number for the command
      aCommand - the regular expression for determining the command is equal to the command entered.
      aMethodName - the name of the method to call.
  • Method Details

    • getCommand

      public String getCommand()
    • getCommandId

      public int getCommandId()
    • getMethodName

      public String getMethodName()
    • getRoom

      public Long getRoom()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • getTheCommandId

      public int getTheCommandId()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • deactivateCommand

      public void deactivateCommand() throws MudException
      Use this method when the command that had to be run, throws an exception.
      Throws:
      MudException