mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-30 02:50:39 +00:00
Refactor output writers
This commit is contained in:
parent
f449a242e4
commit
48b2c7ff8a
42 changed files with 327 additions and 187 deletions
|
@ -1,6 +1,8 @@
|
|||
package org.asamk.signal;
|
||||
|
||||
public interface PlainTextWriter {
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public interface PlainTextWriter extends OutputWriter {
|
||||
|
||||
void println(String format, Object... args);
|
||||
|
||||
|
@ -10,12 +12,7 @@ public interface PlainTextWriter {
|
|||
println("");
|
||||
}
|
||||
|
||||
default void indent(final WriterConsumer subWriter) {
|
||||
subWriter.consume(indentedWriter());
|
||||
}
|
||||
|
||||
interface WriterConsumer {
|
||||
|
||||
void consume(PlainTextWriter writer);
|
||||
default void indent(final Consumer<PlainTextWriter> subWriter) {
|
||||
subWriter.accept(indentedWriter());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue