Class OutputCollector

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public final class OutputCollector
    extends Object
    implements Closeable
    A utility class that will collect strings until a new line is encountered.
    • Constructor Detail

      • OutputCollector

        public OutputCollector​(Consumer<String> output)
    • Method Detail

      • accept

        public void accept​(String input)
        Accept a string as input. The collector will save the inputs until a new line is encountered, or the collector is closed. The newlines are stripped and not present in the output.
        input - The string to accept.