Skip to content

Commit

Permalink
Ansi should implement java.lang.Appendable, fixes #168
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Dec 1, 2020
1 parent 70adaeb commit 8420b9c
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/main/java/org/fusesource/jansi/Ansi.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.fusesource.jansi;

import java.io.IOException;
import java.util.ArrayList;
import java.util.concurrent.Callable;

Expand All @@ -25,7 +26,7 @@
* @author <a href="http://hiramchirino.com">Hiram Chirino</a>
* @since 1.0
*/
public class Ansi {
public class Ansi implements Appendable {

private static final char FIRST_ESC_CHAR = 27;
private static final char SECOND_ESC_CHAR = '[';
Expand Down Expand Up @@ -758,4 +759,21 @@ private Ansi _appendEscapeSequence(char command, Object... options) {
return this;
}

@Override
public Ansi append(CharSequence csq) {
builder.append(csq);
return this;
}

@Override
public Ansi append(CharSequence csq, int start, int end) {
builder.append(csq, start, end);
return this;
}

@Override
public Ansi append(char c) {
builder.append(c);
return this;
}
}

0 comments on commit 8420b9c

Please sign in to comment.