Package revxrsal.commands.orphan
Class Orphans
java.lang.Object
revxrsal.commands.orphan.Orphans
Represents the entrypoint to creation of
OrphanCommand
s.
Methods path(String)
, path(String...)
have the same exact
behavior as Command
annotations.
- @Command("foo bar") -> Orphans.path("foo bar")
- @Command("foo", "bar") -> Orphans.path("foo", "bar")
- @Command("foo bar", "buzz buff") -> Orphans.path("foo bar", "buzz buff")
Registering OrphanCommand
s directly into a CommandHandler.register(Object...)
will throw an exception. Orphan commands should be wrapped using this class as follows:
commandHandler.register(Orphans.path("foo").handler(new Foo()));
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionhandler
(OrphanCommand handler) Sets the handler of this orphan command.static Orphans
Starts the registration of an orphan command.static Orphans
Starts the registration of an orphan command.static Orphans
path
(@NotNull CommandPath path) Starts the registration of an orphan command.
-
Constructor Details
-
Orphans
public Orphans()
-
-
Method Details
-
path
Starts the registration of an orphan command. The input for this method has exactly the same behavior asCommand
.- @Command("foo bar") -> Orphans.path("foo bar")
- Parameters:
path
- The command path. This accepts spaces for commands with subcategories.- Returns:
- A builder
Orphans
. You must callhandler(OrphanCommand)
after.
-
path
Starts the registration of an orphan command. The input for this method has exactly the same behavior asCommand
.- @Command("foo", "bar") -> Orphans.path("foo", "bar")
- Parameters:
paths
- The command paths. These accept spaces for commands with subcategories.- Returns:
- A builder
Orphans
. You must callhandler(OrphanCommand)
after.
-
path
Starts the registration of an orphan command.- Parameters:
path
- The command path. SeeCommandPath
.- Returns:
- A builder
Orphans
. You must callhandler(OrphanCommand)
after.
-
handler
Sets the handler of this orphan command. This can be any class, however it must implementOrphanCommand
.- Parameters:
handler
- The command class logic.- Returns:
- An
OrphanRegistry
that can be passed toCommandHandler.register(Object...)
to be registered.
-