Package sonia.scm.cli
Class Table
java.lang.Object
sonia.scm.cli.Table
This table can be used to display table-like command output
- Since:
- 2.33.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidSets the table headers.voidaddLabelValueRow(String label, String value) Creates a table entry with two columns separated byDEFAULT_LABEL_VALUE_SEPARATOR.voidaddLabelValueRow(String label, String value, String separator) Creates a table entry with two columns separated by the given separator.voidAdd a single row of values to the table.getRows()Returns a list of the table rows.iterator()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
addHeader
Sets the table headers. You can use resource keys which will be translated using the related resource bundle.- Parameters:
keys- actual names or resource keys for your table header
-
addRow
Add a single row of values to the table.- Parameters:
row- values for a single table row
-
addLabelValueRow
Creates a table entry with two columns separated byDEFAULT_LABEL_VALUE_SEPARATOR.- Parameters:
label- label for the left table columnvalue- value for the right table column
-
addLabelValueRow
Creates a table entry with two columns separated by the given separator.- Parameters:
label- label for the left table columnvalue- value for the right table columnseparator- separator used to separate the label from the value
-
getRows
Returns a list of the table rows. This is required for the internal table implementation.- Returns:
- a list of the table rows
-
iterator
-