public class TextTable
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
TextTable.Alignment |
static class |
TextTable.Column |
static class |
TextTable.Row |
Constructor and Description |
---|
TextTable(java.util.List<TextTable.Column> columns) |
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.Object... values) |
void |
append(java.lang.StringBuilder destination,
java.lang.String lineEnding)
Appends the data formatted as a table to the given string builder.
|
java.lang.String |
build(java.lang.String lineEnding) |
void |
clear() |
static TextTable.Column |
column(java.lang.String header) |
static TextTable.Column |
column(java.lang.String header,
TextTable.Alignment alignment) |
java.util.List<TextTable.Column> |
getColumns() |
public TextTable(java.util.List<TextTable.Column> columns)
public static TextTable.Column column(java.lang.String header)
public static TextTable.Column column(java.lang.String header, TextTable.Alignment alignment)
public java.lang.String build(java.lang.String lineEnding)
public void append(java.lang.StringBuilder destination, java.lang.String lineEnding)
The generated table is compliant with the markdown file format.
destination
- a string builder to append the table tolineEnding
- the line ending to use for each row of the tablepublic void add(@Nonnull java.lang.Object... values)
public void clear()
public java.util.List<TextTable.Column> getColumns()