Class ManualColumnHeaderResolvingStrategy<I>

java.lang.Object
software.xdev.vaadin.grid_exporter.column.headerresolving.ManualColumnHeaderResolvingStrategy<I>
Type Parameters:
I - The identifier of the column, e.g. the key or the column itself
All Implemented Interfaces:
ColumnHeaderResolvingStrategy

public class ManualColumnHeaderResolvingStrategy<I> extends Object implements ColumnHeaderResolvingStrategy
Resolves the header-text by using the unique identification ManualColumnHeaderResolvingStrategy and find the corresponding resolving function for the identification in a map.
This function is the used to resolve the header-text.

Example:
new ManualColumnHeaderResolvingStrategy( col -> col.getKey(), Map.of( "name", "Username", "pw", "Password"))

  • Field Details

    • identifierResolver

      protected final Function<com.vaadin.flow.component.grid.Grid.Column<?>,I> identifierResolver
    • headerTextResolverMap

      protected final Map<I,Function<I,String>> headerTextResolverMap
  • Constructor Details

    • ManualColumnHeaderResolvingStrategy

      public ManualColumnHeaderResolvingStrategy(Function<com.vaadin.flow.component.grid.Grid.Column<?>,I> identifierResolver, Map<I,Function<I,String>> headerTextResolverMap)
  • Method Details

    • resolve

      public Optional<String> resolve(com.vaadin.flow.component.grid.Grid.Column<?> column)
      Description copied from interface: ColumnHeaderResolvingStrategy
      Resolves the text for a column header
      Specified by:
      resolve in interface ColumnHeaderResolvingStrategy
      Parameters:
      column - The column for which the header text should be resolved
      Returns:
      Optional.empty() when the text could not be resolved and the next function should be used.
      If a value was found the Optional contains the string.