Package com.example.common.command
Class BaseCommand
java.lang.Object
com.example.common.command.BaseCommand
- All Implemented Interfaces:
Command
- Direct Known Subclasses:
CountUserCommand
,ExitCommand
,HelpCommand
,LoginCommand
,MessageCommand
Abstract class that serves as the base for command implementations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ChatInterface
protected String
protected MessageSender
protected String
-
Constructor Summary
ConstructorsConstructorDescriptionBaseCommand
(MessageSender messageSender, ChatInterface chatInterface) Constructor for the BaseCommand class. -
Method Summary
Modifier and TypeMethodDescriptionGet the description of the command.getName()
Get the name of the command.
-
Field Details
-
name
-
description
-
messageSender
-
chatInterface
-
-
Constructor Details
-
BaseCommand
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
Get the name of the command. -
getDescription
Get the description of the command.- Specified by:
getDescription
in interfaceCommand
- Returns:
- The description of the command.
-