Package io.bdeploy.common.cli.data
Interface DataTable
- All Superinterfaces:
RenderableResult
- All Known Implementing Classes:
DataTableBase,DataTableCsv,DataTableJson,DataTableText
A table displaying a series of
DataTableCells.-
Method Summary
Modifier and TypeMethodDescriptionAdd a horizontal ruler row at the current position.column(DataTableColumn column) Adds a column to the table.Adds a column to the table.row()Creates a builder which will insert a row into the table when its build() method is called.row(List<DataTableCell> dataPoints) setCaption(String caption) setExitCode(ExitCode exitCode) setHideHeadersHint(boolean hide) setIndentHint(int hint) setLineWrapHint(boolean wrap) setWordBreakHint(boolean allowBreak) Methods inherited from interface io.bdeploy.common.cli.data.RenderableResult
getExitCode, render
-
Method Details
-
setCaption
- Parameters:
caption- The caption of the table. The caption row is hidden if no caption is set.
-
setExitCode
- Parameters:
exitCode- indicates whether operation was successful or had any errors.
-
column
Adds a column to the table. All columns must be added before adding actual data.- Parameters:
label- the label of the column, used for human readable formats.preferredWidth- the preferred width in characters.
-
column
Adds a column to the table. All columns must be added before adding actual data.- Parameters:
column- the column definition.
-
row
- Parameters:
dataPoints- a series of cells which make up a row in the table.
-
row
DataTableRowBuilder row()Creates a builder which will insert a row into the table when its build() method is called. -
getColumns
List<DataTableColumn> getColumns()- Returns:
- all previously registered columns.
-
addHorizontalRuler
DataTable addHorizontalRuler()Add a horizontal ruler row at the current position. -
setHideHeadersHint
- Parameters:
hide- whether to hide column headers. This is just a hint and may be ignored depending on the output format.
-
setIndentHint
- Parameters:
hint- by how much to indent the rendered table. This is just a hint and may be ignored depending on the output format.
-
setLineWrapHint
- Parameters:
wrap- whether overflow should be cut off or wrapped into an additional line in the table. This is just a hint and may be ignored depending on the output format.
-
setWordBreakHint
- Parameters:
allowBreak- iftruebreaking words apart is allowed. Iffalse(default) breaking words is only allowed if a single word cannot fit within a column.
-