Package org.dnsge.util.tableprinter.row
Class RowMappingProtocol<T>
- java.lang.Object
-
- org.dnsge.util.tableprinter.row.RowMappingProtocol<T>
-
- Type Parameters:
T- Type of object that is used as input
public class RowMappingProtocol<T> extends java.lang.Object- Version:
- 1.5.3
-
-
Constructor Summary
Constructors Constructor Description RowMappingProtocol(TableHeader tableHeader, java.util.function.Function<T,java.util.List<?>> mappingFunction)Creates a new RowMappingProtocol with aTableHeaderand aFunctionthat takes an input of typeTand returns a list of Objects
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>apply(T input)Applies the mapping function onto an object of typeTRowFactory<T>getRowFactory()Returns aRowFactoryfor this RowMappingProtocol.TableHeadergetTableHeader()Returns theTableHeaderfor this RowMappingProtocol.
-
-
-
Constructor Detail
-
RowMappingProtocol
public RowMappingProtocol(TableHeader tableHeader, java.util.function.Function<T,java.util.List<?>> mappingFunction)
Creates a new RowMappingProtocol with aTableHeaderand aFunctionthat takes an input of typeTand returns a list of Objects- Parameters:
tableHeader-TableHeadermappingFunction-Functionthat maps an object of typeT
-
-
Method Detail
-
apply
public java.util.List<java.lang.String> apply(T input)
Applies the mapping function onto an object of typeT- Parameters:
input- Object to map from- Returns:
Listof Strings of results (Object::toString is called on each result)
-
getTableHeader
public TableHeader getTableHeader()
Returns theTableHeaderfor this RowMappingProtocol.- Returns:
- the
TableHeaderfor this RowMappingProtocol
-
getRowFactory
public RowFactory<T> getRowFactory()
Returns aRowFactoryfor this RowMappingProtocol.- Returns:
- a
RowFactoryfor this RowMappingProtocol
-
-