Package com.example.common.command
Interface CommandsInterface
- All Known Implementing Classes:
CommandsCollection
public interface CommandsInterface
The CommandsInterface provides methods to manage a collection of commands.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a command to the collection.boolean
Check if the collection contains a command with the specified name.Get all commands in the collection.Get a command by its name.void
Remove a command by its name from the collection.int
size()
Get the size of the collection.
-
Method Details
-
add
Add a command to the collection.- Parameters:
command
- The command to add.
-
remove
Remove a command by its name from the collection.- Parameters:
name
- The name of the command to remove.
-
size
int size()Get the size of the collection.- Returns:
- The size of the collection.
-
getAllCommands
Collection<Command> getAllCommands()Get all commands in the collection.- Returns:
- A collection of all commands.
-
contains
Check if the collection contains a command with the specified name.- Parameters:
name
- The name of the command to check for.- Returns:
- true if the collection contains the command, false otherwise.
-
getByName
Get a command by its name.- Parameters:
name
- The name of the command.- Returns:
- The command object with the specified name.
-