@Test public void testTableFormatter() { final TableFormatter tableFormatter = new TableFormatter( new TableEntry<String>("Data Type", "-", "s"), new TableEntry<String>("Export", "-", "s"), new TableEntry<String>("Delete", "-", "s")); tableFormatter.addRow( new TableEntry<String>("portlet-definition", "-", "s"), new TableEntry<Boolean>(true, "-", "b"), new TableEntry<Boolean>(true, "-", "b")); tableFormatter.addRow( new TableEntry<String>("portlet-type", "-", "s"), new TableEntry<Boolean>(true, "-", "b"), new TableEntry<Boolean>(true, "-", "b")); tableFormatter.addRow( new TableEntry<String>("entity", "-", "s"), new TableEntry<Boolean>(true, "-", "b"), new TableEntry<Boolean>(false, "-", "b")); final StringBuilder result = new StringBuilder(); tableFormatter.format(new Formatter(result)); final String expected = " Data Type | Export | Delete " + newline + "--------------------+--------+--------" + newline + " portlet-definition | true | true " + newline + " portlet-type | true | true " + newline + " entity | true | false " + newline; assertEquals(expected, result.toString()); }
public TableFormatter(TableEntry<?> heading, TableEntry<?>... headings) { this(null, heading, headings); }
TableFormatter { public TableFormatter(TableEntry<?> heading, TableEntry<?>... headings) { this(null, heading, headings); } }
TableFormatter { public TableFormatter(TableEntry<?> heading, TableEntry<?>... headings) { this(null, heading, headings); } TableFormatter(TableEntry<?> heading, TableEntry<?>... headings); private  TableFormatter(Formatter f, TableEntry<?> firstHeading, TableEntry<?>... headings); }
TableFormatter { public TableFormatter(TableEntry<?> heading, TableEntry<?>... headings) { this(null, heading, headings); } TableFormatter(TableEntry<?> heading, TableEntry<?>... headings); private  TableFormatter(Formatter f, TableEntry<?> firstHeading, TableEntry<?>... headings); void addRow(TableEntry<?> firstValue, TableEntry<?>... values); void format(Formatter formatter); }
TableFormatter { public TableFormatter(TableEntry<?> heading, TableEntry<?>... headings) { this(null, heading, headings); } TableFormatter(TableEntry<?> heading, TableEntry<?>... headings); private  TableFormatter(Formatter f, TableEntry<?> firstHeading, TableEntry<?>... headings); void addRow(TableEntry<?> firstValue, TableEntry<?>... values); void format(Formatter formatter);  }