public class TablePrinter extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TablePrinter.Column |
static interface |
TablePrinter.TableWriter |
Constructor and Description |
---|
TablePrinter() |
Modifier and Type | Method and Description |
---|---|
String |
asText()
Prints the table as a text string
|
List<String> |
asTextLines()
Returns a list of text lines for easier printing on other output formats
|
TablePrinter.Column |
column(int index)
Looks up the column using its index; lazily creating one if required
|
TablePrinter.Column |
column(String header)
Looks up the column using the header name and returns the column object so it
can be configured
|
void |
columns(String... headers)
Defines the columns of the table
|
void |
print() |
void |
print(PrintStream out) |
void |
print(TablePrinter.TableWriter out) |
void |
row(String... values)
Adds a new row of values
|
public void columns(String... headers)
public TablePrinter.Column column(String header)
public TablePrinter.Column column(int index)
public void row(String... values)
public void print()
public String asText()
public List<String> asTextLines()
public void print(PrintStream out)
public void print(TablePrinter.TableWriter out)
Copyright © 2011–2016 Red Hat. All rights reserved.