Class RowMappingProtocol<T>

  • Type Parameters:
    T - Type of object that is used as input

    public class RowMappingProtocol<T>
    extends java.lang.Object
    Specifies how a RowFactory should make a TableRow from an object of type T
    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 a TableHeader and a Function that takes an input of type T and returns a list of Objects
    • Constructor Detail

      • RowMappingProtocol

        public RowMappingProtocol​(TableHeader tableHeader,
                                  java.util.function.Function<T,​java.util.List<?>> mappingFunction)
        Creates a new RowMappingProtocol with a TableHeader and a Function that takes an input of type T and returns a list of Objects
        Parameters:
        tableHeader - TableHeader
        mappingFunction - Function that maps an object of type T
    • Method Detail

      • apply

        public java.util.List<java.lang.String> apply​(T input)
        Applies the mapping function onto an object of type T
        Parameters:
        input - Object to map from
        Returns:
        List of Strings of results (Object::toString is called on each result)