Package de.hybris.platform.util
Class ASCIITableReport
java.lang.Object
de.hybris.platform.util.ASCIITableReport
This builder allows easily to build ASCII tables around any data. Note that this implementation is not thread-safe.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionaddDataRow(String... dataRow) Adds data row to the report.static ASCIITableReportbuilder()Disables all row titles which are normally displayed on left-hand side of the table.Enables all row titles which were disabled with use ofdisableRowTitles()method.getTable()Gets report as ASCII table in the String.voidPrints report as ASCII table to the standard output.Title for the last data row defined byaddDataRow(String...)method.withTopHeaders(String... headers) Allows to define top columns headers.
-
Field Details
-
EMPTY_CELL_MARKER
- See Also:
-
-
Method Details
-
builder
-
disableRowTitles
Disables all row titles which are normally displayed on left-hand side of the table. -
enableRowTitles
Enables all row titles which were disabled with use ofdisableRowTitles()method. -
withTopHeaders
Allows to define top columns headers. Headers will be printed in the same order as passed to this method.builder.withTopHeaders("Foo", "Bar", "Baz")- Parameters:
headers- top column headers in form of varargs.
-
addDataRow
Adds data row to the report. Row will be printed in the same order as passed to this method. If methodtitledBy(String)will be used as next in chain title for this row will be printed out as very first on the left hand side.builder.addDataRow("foo", "bar", "baz")- Parameters:
dataRow- data row in form of varargs.
-
titledBy
Title for the last data row defined byaddDataRow(String...)method. This method must be used right after call toaddDataRow(String...)to apply it to correct row.builder.addDataRow("foo", "bar", "baz").titledBy("My Row")- Parameters:
rowTitle- title for the last defined data row
-
printTable
public void printTable()Prints report as ASCII table to the standard output. -
getTable
Gets report as ASCII table in the String.
-