public class TableLayoutBuilder extends Object implements org.apache.commons.lang3.builder.Builder<TableLayout>, Cloneable
Construct a layout for a table.
Constructor and Description |
---|
TableLayoutBuilder() |
Modifier and Type | Method and Description |
---|---|
TableLayoutBuilder |
addColumn(String name)
Add a column to the table layout.
|
TableLayoutBuilder |
addColumns(Iterable<String> columns)
Add columns to the layout.
|
TableLayoutBuilder |
addColumns(String... columns)
Add columns to the layout.
|
TableLayout |
build() |
TableLayoutBuilder |
clone()
Clone this layout command.
|
static TableLayoutBuilder |
copy(TableLayout layout)
Construct a new builder that is a copy of an existing layout.
|
int |
getColumnCount()
Get the number of columns currently in the layout.
|
public static TableLayoutBuilder copy(TableLayout layout)
Construct a new builder that is a copy of an existing layout.
layout
- The layout to copy.public TableLayoutBuilder addColumn(String name)
Add a column to the table layout. Each column must have a unique, non-null name.
name
- The column name.IllegalArgumentException
- if the column already exists.public TableLayoutBuilder addColumns(Iterable<String> columns)
Add columns to the layout.
columns
- The columns to add.public TableLayoutBuilder addColumns(String... columns)
Add columns to the layout.
columns
- The columns to add.public int getColumnCount()
Get the number of columns currently in the layout.
public TableLayoutBuilder clone()
Clone this layout command. Used to build multiple layouts from the same initial columns.
public TableLayout build()
build
in interface org.apache.commons.lang3.builder.Builder<TableLayout>