Class CategorySearchData


  • public class CategorySearchData
    extends Object
    Takes a list of / separated category paths and splits them into separate levels. Also saves all leaf paths.
    • Constructor Detail

      • CategorySearchData

        public CategorySearchData()
        Creates a new instance and splits the category paths into levels and leafs.
    • Method Detail

      • getCategoryLvlDepth

        public int getCategoryLvlDepth()
        Returns the number of the deepest category level from the path list.
        Returns:
        the category depth.
      • getCategoryLeaf

        public Collection<String> getCategoryLeaf()
        Returns the leaf entries of each path.
        Returns:
        the leaf entries.
      • toSourceItem

        public void toSourceItem​(Map<String,​Object> sourceData,
                                 String categoryFieldName)
        Copies the data of this instance into the sourceData map. The name of the category field is used as prefix, followed by either
        1. _lvl_x
        2. _leaf
        for each level and once for all leafs.
        Parameters:
        sourceData - the source item where the data will be stored.
        categoryFieldName - the category field which is used to obtain the name of the stored fields.