Package org.dnsge.util.tableprinter.row
Class RowFactory<T>
- java.lang.Object
-
- org.dnsge.util.tableprinter.row.RowFactory<T>
-
-
Constructor Summary
Constructors Constructor Description RowFactory(RowMappingProtocol<T> protocol)
Creates a new RowFactory that creates rows based off of aRowMappingProtocol
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TableRow
makeRow(T object)
Creates aTableRow
from an object of typeT
static TableRow
makeRowFromTableRowItem(TableRowItem item)
Creates a newTableRow
from aTableRowItem
Objectjava.util.List<TableRow>
makeRows(java.util.List<T> objects)
java.util.List<TableRow>
makeRows(T... objects)
Creates multipleTableRows
from objects of typeT
static java.util.List<TableRow>
makeRowsFromColumns(java.util.List<TableColumn> items)
static java.util.List<TableRow>
makeRowsFromColumns(TableColumn... items)
Creates an Array ofTableRows
from an Array ofTableRowItems
static java.util.List<TableRow>
objectsToRowList(java.util.List<TableRowItem> rows)
static java.util.List<TableRow>
objectsToRowList(TableRowItem... rows)
-
-
-
Constructor Detail
-
RowFactory
public RowFactory(RowMappingProtocol<T> protocol)
Creates a new RowFactory that creates rows based off of aRowMappingProtocol
- Parameters:
protocol
-RowMappingProtocol
that will be used to create rows
-
-
Method Detail
-
makeRows
@SafeVarargs public final java.util.List<TableRow> makeRows(T... objects)
Creates multipleTableRows
from objects of typeT
- Parameters:
objects
- Array of objects of typeT
to be made into rows- Returns:
- Array of new
TableRows
- See Also:
makeRow(Object)
-
makeRowFromTableRowItem
public static TableRow makeRowFromTableRowItem(TableRowItem item)
Creates a newTableRow
from aTableRowItem
Object- Parameters:
item
-TableRowItem
to make the row from- Returns:
- he new
TableRow
T
-
makeRowsFromColumns
public static java.util.List<TableRow> makeRowsFromColumns(TableColumn... items)
Creates an Array ofTableRows
from an Array ofTableRowItems
- Parameters:
items
-TableRowItems
to make the rows from- Returns:
- The new
TableRows
-
objectsToRowList
public static java.util.List<TableRow> objectsToRowList(TableRowItem... rows)
- Parameters:
rows
- Array ofTableRowItems
- Returns:
List
ofTableRows
from theTableRowItem
array
-
objectsToRowList
public static java.util.List<TableRow> objectsToRowList(java.util.List<TableRowItem> rows)
- Parameters:
rows
-List
ofTableRowItems
- Returns:
List
ofTableRows
from theTableRowItem
array
-
makeRowsFromColumns
public static java.util.List<TableRow> makeRowsFromColumns(java.util.List<TableColumn> items)
- Parameters:
items
-List
ofTableColumns
- Returns:
List
ofTableRows
-
-