Class CommandParser

java.lang.Object
CommandParser

public final class CommandParser
extends Object
  • Method Details

    • parse

      public static Command parse​(int senderId, String sender, String commandString)
      Parses a string command received from a client into its component parts, and creates a Command object representing it.
      Parameters:
      senderId - The backend-generated ID for the sender of the command
      sender - The current username of the sender
      commandString - The command string to parse
      Returns:
      a subclass of Command corresponding to the string
      Throws:
      IllegalArgumentException - if the commandString is syntactically invalid, meaning that it is of an unrecognized type or its components do not match its type. You do not need to modify this file.