Package revxrsal.commands.cli.core
Class CommandLineActor
java.lang.Object
revxrsal.commands.cli.core.CommandLineActor
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ConsoleActor
,CommandActor
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
Replies to the sender with the specified message, and marks it as an error depending on the platform.Returns the command handler that constructed this actor@NotNull PrintStream
Returns thePrintStream
that is being used to send errors to the console.@NotNull InputStream
Returns theInputStream
that is being used to take input from the console.@NotNull String
getName()
Returns the name of this actor.@NotNull PrintStream
Returns thePrintStream
that is being used to send normal output to the console.@NotNull Scanner
Returns theScanner
that is being polled for input.@NotNull UUID
Returns the unique UID of this subject.void
Replies to the sender with the specified message.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface revxrsal.commands.command.CommandActor
as, errorLocalized, getLocale, getTranslator, replyLocalized
-
Constructor Details
-
CommandLineActor
-
-
Method Details
-
getInputStream
Description copied from interface:ConsoleActor
Returns theInputStream
that is being used to take input from the console.- Specified by:
getInputStream
in interfaceConsoleActor
- Returns:
- The console's input stream.
-
getOutputStream
Description copied from interface:ConsoleActor
Returns thePrintStream
that is being used to send normal output to the console.- Specified by:
getOutputStream
in interfaceConsoleActor
- Returns:
- The console's output stream.
-
getErrorStream
Description copied from interface:ConsoleActor
Returns thePrintStream
that is being used to send errors to the console.- Specified by:
getErrorStream
in interfaceConsoleActor
- Returns:
- The console's output stream.
-
getScanner
Description copied from interface:ConsoleActor
Returns theScanner
that is being polled for input.- Specified by:
getScanner
in interfaceConsoleActor
- Returns:
- The console scanner.
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
getName
Description copied from interface:CommandActor
Returns the name of this actor. Varies depending on the platform.- Specified by:
getName
in interfaceCommandActor
- Returns:
- The actor name
-
getUniqueId
Description copied from interface:CommandActor
Returns the unique UID of this subject. Varies depending on the platform.Although some platforms explicitly have their underlying senders have UUIDs, some platforms may have to generate this UUID based on other available data.
- Specified by:
getUniqueId
in interfaceCommandActor
- Returns:
- The UUID of this subject.
-
reply
Description copied from interface:CommandActor
Replies to the sender with the specified message.Varies depending on the platform.
- Specified by:
reply
in interfaceCommandActor
- Parameters:
message
- Message to reply with.
-
error
Description copied from interface:CommandActor
Replies to the sender with the specified message, and marks it as an error depending on the platform.Note that, in certain platforms where no "error" mode is available, this may effectively be equivilent to calling
CommandActor.reply(String)
.This method should not throw any exceptions.
- Specified by:
error
in interfaceCommandActor
- Parameters:
message
- Message to reply with
-
getCommandHandler
Description copied from interface:CommandActor
Returns the command handler that constructed this actor- Specified by:
getCommandHandler
in interfaceCommandActor
- Returns:
- The command handler
-