Package org.incendo.cloud.internal
Interface CommandRegistrationHandler<C>
- Type Parameters:
C- command sender type
- All Known Implementing Classes:
CommandRegistrationHandler.NullCommandRegistrationHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Utility that registers commands natively for whatever
platform the library is used in. This can do nothing, if
the target platform does not have its own concept of commands
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final class -
Method Summary
Modifier and TypeMethodDescriptionstatic <C> @NonNull CommandRegistrationHandler<C> Create a newCommandRegistrationHandlerthat does nothingbooleanregisterCommand(@NonNull Command<C> command) Attempt to register the commanddefault voidunregisterRootCommand(@NonNull CommandComponent<C> rootCommand) Requests that the givenrootCommandshould be unregistered.
-
Method Details
-
nullCommandRegistrationHandler
Create a newCommandRegistrationHandlerthat does nothing- Type Parameters:
C- command sender type- Returns:
- Constructed registration
-
registerCommand
Attempt to register the command- Parameters:
command- Command to register- Returns:
trueif the command was registered successfully, elsefalse
-
unregisterRootCommand
Requests that the givenrootCommandshould be unregistered.- Parameters:
rootCommand- The command to delete
-