X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/6c33a89f82ffac98454c6f854e1c8877e3941f6a..03c30519b11e9772eecdc74f89d350bdecd20361:/src/main/java/org/asamk/signal/PlainTextWriter.java diff --git a/src/main/java/org/asamk/signal/PlainTextWriter.java b/src/main/java/org/asamk/signal/PlainTextWriter.java new file mode 100644 index 00000000..91a4dbba --- /dev/null +++ b/src/main/java/org/asamk/signal/PlainTextWriter.java @@ -0,0 +1,23 @@ +package org.asamk.signal; + +import java.io.IOException; + +public interface PlainTextWriter { + + void println(String format, Object... args) throws IOException; + + PlainTextWriter indentedWriter(); + + default void println() throws IOException { + println(""); + } + + default void indent(final WriterConsumer subWriter) throws IOException { + subWriter.consume(indentedWriter()); + } + + interface WriterConsumer { + + void consume(PlainTextWriter writer) throws IOException; + } +}