Interface CommandCatalog
- All Known Implementing Classes:
CommandCatalog.DefaultCommandCatalog
public interface CommandCatalog
Interface defining contract to handle existing
CommandRegistration
s.-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets allCommandRegistration
s mapped with their names.static CommandCatalog
of()
Gets an instance of a defaultCommandCatalog
.static CommandCatalog
of
(Collection<CommandResolver> resolvers, ShellContext shellContext) Gets an instance of a defaultCommandCatalog
.void
register
(CommandRegistration... registration) Register aCommandRegistration
.void
unregister
(String... commandName) Unregister aCommandRegistration
by its command name.void
unregister
(CommandRegistration... registration) Unregister aCommandRegistration
.
-
Method Details
-
register
Register aCommandRegistration
.- Parameters:
registration
- the command registration
-
unregister
Unregister aCommandRegistration
.- Parameters:
registration
- the command registration
-
unregister
Unregister aCommandRegistration
by its command name.- Parameters:
commandName
- the command name
-
getRegistrations
Map<String,CommandRegistration> getRegistrations()Gets allCommandRegistration
s mapped with their names. Returned map is a copy and cannot be used to register new commands.- Returns:
- all command registrations
-
of
Gets an instance of a defaultCommandCatalog
.- Returns:
- default command catalog
-
of
Gets an instance of a defaultCommandCatalog
.- Parameters:
resolvers
- the command resolversshellContext
- the shell context- Returns:
- default command catalog
-