Class IOHandler


  • public abstract class IOHandler
    extends Object
    This class is used to handle input and output when executing Command.
    • Field Detail

      • value

        protected volatile String value
      • flag

        protected volatile boolean flag
    • Constructor Detail

      • IOHandler

        public IOHandler()
    • Method Detail

      • getConsoleIoHandler

        public static IOHandler getConsoleIoHandler()
      • setConsoleIoHandler

        public static void setConsoleIoHandler​(IOHandler consoleIoHandler)
      • output

        public abstract void output​(String output)
        Used to output String
        Parameters:
        output - output String
      • outputLang

        public void outputLang​(String key,
                               Object... objects)
        Used to output formatted language key
        Parameters:
        key - the language key
        objects - the objects need to replace
      • input

        public void input​(@Nullable
                          String input)
        Used to input String
        Parameters:
        input - the inputted String
      • hasInput

        public boolean hasInput()
        Indicate there needs the MiraiCode of this input if it is a Mirai Message, or the string value of this input.
        Returns:
        true if there is an input String, false otherwise
        See Also:
        hasInput(boolean)
      • hasInput

        public abstract boolean hasInput​(boolean flag)
        Indicate there needs an input String.
        Parameters:
        flag - true if you need the MiraiCode of this input when it is a Mirai Message, false if you need the string value of this input
        Returns:
        true if there is an input String, false otherwise