public class TablePrinter extends Object
| Modifier and Type | Field and Description |
|---|---|
static TablePrinter |
DefaultTablePrinter |
| Constructor and Description |
|---|
TablePrinter() |
| Modifier and Type | Method and Description |
|---|---|
String |
print(Iterable<String> headers,
Iterable<? extends Iterable<String>> data)
Prints the specified headers and data to a string.
|
void |
print(Iterable<String> headers,
Iterable<? extends Iterable<String>> data,
OutputStream os)
Prints the specified headers and data to the specified OutputStream.
|
String |
print(TableProvider tableProvider)
Prints the headers and data exposed by the specified TableProvider to the specified OutputStream.
|
void |
print(TableProvider tableProvider,
OutputStream os)
Prints the headers and data exposed by the specified TableProvider to the specified OutputStream.
|
public static TablePrinter DefaultTablePrinter
public String print(TableProvider tableProvider)
tableProvider - that describes the table to printpublic String print(Iterable<String> headers, Iterable<? extends Iterable<String>> data)
headers - describes the table's columns. Should have the same number of columns as each of the data rows.data - describes the table's rows. Each element in the outer Iterable is a row and each element in the inner
Iterable represents this row's columns.public void print(TableProvider tableProvider, OutputStream os)
tableProvider - that describes the table to printos - to which the String representation of the table will be writtenpublic void print(Iterable<String> headers, Iterable<? extends Iterable<String>> data, OutputStream os)
headers - describes the table's columns. Should have the same number of columns as each of the data rows.data - describes the table's rows. Each element in the outer Iterable is a row and each element in the inner
Iterable represents this row's columns.os - to which the String representation of the headers and data will be writtenCopyright © 2018–2019 none. All rights reserved.