Package net.minheur.potoflux.terminal
Class CommandRegistry
java.lang.Object
net.minheur.potoflux.terminal.CommandRegistry
Reg containing all commands of the app.
Commands should be added to this
Commands should be added to this
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a command to the regstatic booleancontainsKey(String pKey) Checks if a key is already used by another commandstatic Collection<Command>getAll()Getter for all commandsstatic CommandgetCommandWithKey(String pKey) Gets a command object from his key
-
Constructor Details
-
CommandRegistry
public CommandRegistry()
-
-
Method Details
-
getAll
Getter for all commands- Returns:
- all commands
-
add
Adds a command to the reg -
containsKey
Checks if a key is already used by another command- Parameters:
pKey- command key to check if used- Returns:
- if the key is already used
-
getCommandWithKey
Gets a command object from his key- Parameters:
pKey- command key to get the command from- Returns:
- the command associated to the key, or null if the command doesn't exist
-