Class BaseCommand

java.lang.Object
com.example.common.command.BaseCommand
All Implemented Interfaces:
Command
Direct Known Subclasses:
CountUserCommand, ExitCommand, HelpCommand, LoginCommand, MessageCommand

public abstract class BaseCommand extends Object implements Command
Abstract class that serves as the base for command implementations.
  • Field Details

  • Constructor Details

    • BaseCommand

      public BaseCommand(MessageSender messageSender, ChatInterface chatInterface)
      Constructor for the BaseCommand class.
      Parameters:
      messageSender - The MessageSender object for sending messages.
      chatInterface - The ChatInterface containing information about clients in the chat.
  • Method Details

    • getName

      public String getName()
      Get the name of the command.
      Specified by:
      getName in interface Command
      Returns:
      The name of the command.
    • getDescription

      public String getDescription()
      Get the description of the command.
      Specified by:
      getDescription in interface Command
      Returns:
      The description of the command.