public class TableBuilder extends AbstractTableWriter implements org.apache.commons.lang3.builder.Builder<Table>
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, writeRow
public TableBuilder(TableLayout layout)
layout
- The table layout.public TableLayout getLayout()
TableWriter
getLayout
in interface TableWriter
public void close()
AbstractTableWriter
close
in interface Closeable
close
in interface AutoCloseable
close
in interface TableWriter
close
in class AbstractTableWriter
public void writeRow(List<?> row)
TableWriter
writeRow
in interface TableWriter
row
- 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)
row
- The row to add.IllegalArgumentException
- if the row has the wrong length.public void addRow(Object... row)
row
- The row to add.IllegalArgumentException
- if the row has the wrong length.