Package com.example.common.command
Interface Command
- All Known Implementing Classes:
BaseCommand
,CountUserCommand
,ExitCommand
,HelpCommand
,LoginCommand
,MessageCommand
public interface Command
The Command interface represents a command that can be executed based on a BodyMessage.
-
Method Summary
Modifier and TypeMethodDescriptionexecute
(BodyMessage bodyMessage) Executes the command based on the provided BodyMessage.Gets the description of the command.getName()
Gets the name of the command.
-
Method Details
-
execute
Executes the command based on the provided BodyMessage.- Parameters:
bodyMessage
- The BodyMessage containing the command details.- Returns:
- The execution status of the command.
- Throws:
IOException
- if an I/O error occurs during command execution.
-
getName
String getName()Gets the name of the command.- Returns:
- The name of the command.
-
getDescription
String getDescription()Gets the description of the command.- Returns:
- The description of the command.
-