public class TableBuilder extends AbstractTableWriter implements org.apache.commons.lang3.builder.Builder<Table>
Builder to construct tables.
| Constructor and Description |
|---|
TableBuilder(List<String> columns) |
TableBuilder(TableLayout layout)
Construct a new builder using a particular layout.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRow(List<?> row)
Add a row to the table.
|
void |
addRow(Object... row)
Add a row to the table.
|
Table |
build() |
void |
close()
No-op close implementaiton.
|
TableLayout |
getLayout()
Get the layout of this table.
|
void |
writeRow(List<?> row)
Write a row to the table.
|
checkRowWidth, writeRowpublic TableBuilder(TableLayout layout)
Construct a new builder using a particular layout.
layout - The table layout.public TableLayout getLayout()
TableWriterGet the layout of this table.
getLayout in interface TableWriterpublic void close()
AbstractTableWriterNo-op close implementaiton.
close in interface Closeableclose in interface AutoCloseableclose in interface TableWriterclose in class AbstractTableWriterpublic void writeRow(List<?> row)
TableWriterWrite a row to the table. This method is thread-safe.
writeRow in interface TableWriterrow - A row of values. If the table requires more columns, the remaining columns are empty. The row is copied if necessary; the caller is free to re-use the same array for returnValue calls.public void addRow(List<?> row)
Add a row to the table.
row - The row to add.IllegalArgumentException - if the row has the wrong length.public void addRow(Object... row)
Add a row to the table.
row - The row to add.IllegalArgumentException - if the row has the wrong length.