Class ExcelCollectionFormatter

java.lang.Object
com.hybris.backoffice.excel.template.ExcelCollectionFormatter
All Implemented Interfaces:
CollectionFormatter

public class ExcelCollectionFormatter extends Object implements CollectionFormatter
The pattern used for a collection of "apple","banana","orange" looks as follows: {apple},{banana},{orange}
  • Constructor Details

    • ExcelCollectionFormatter

      public ExcelCollectionFormatter()
  • Method Details

    • formatToString

      public String formatToString(@Nonnull Collection<String> collection)
      Formats given collection to a string that can be put to a single Excel cell.
      Specified by:
      formatToString in interface CollectionFormatter
      Parameters:
      collection - of elements that are intended to be put in a single Excel cell
      Returns:
      collection representation ready to be put to a single Excel cell
    • formatToCollection

      public Set<String> formatToCollection(@Nonnull String string)
      Extracts the collection from a single Excel cell to a collection. The maximum number of elements extracted is 1000.
      Specified by:
      formatToCollection in interface CollectionFormatter
      Parameters:
      string - formatted collection from a single Excel cell
      Returns:
      collection of extracted elements