Class VariantMatrixFactoryUtil
java.lang.Object
de.hybris.platform.commercefacades.product.converters.populator.VariantMatrixFactoryUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intaddVariantsWithValueCategories(ProductModel baseProductModel, int dimension) Generate sample variants, using the category tree and adds those variants to the productmodel.static List<List<CategoryModel>>createCategoriyModelTree(int dimension, Map<String, List<String>> categoryNamesMap) Creates the structure of the categories and value categories.protected static StringgetIndent(int level) static ProductModelstatic VariantValueCategoryModelmockNewValueCategory(VariantCategoryModel parentCategory, int sequence, String valueCategoryName) static GenericVariantProductModelmockNewVariantModel(ProductModel baseProductModel, List<CategoryModel> valueCategories, int id) static ProductModelmockNewVariantProductModelWithVariantsAndValueCategories(int dimension) static ProductDatamockProductDataWithTree(ProductModel firstVariant) static List<List<CategoryModel>>multiplyPermutations(List<List<CategoryModel>> allPermutations, List<CategoryModel> valueCategories) Combines the lists of generated values this way:
-
Field Details
-
BASE_PRODUCT_CODE
- See Also:
-
FIT
- See Also:
-
COLOR
- See Also:
-
SIZE
- See Also:
-
DIMENSION4
- See Also:
-
DIMENSION5
- See Also:
-
DIMENSION6
- See Also:
-
dimensions
-
categoryNamesMap
-
-
Constructor Details
-
VariantMatrixFactoryUtil
public VariantMatrixFactoryUtil()
-
-
Method Details
-
addVariantsWithValueCategories
Generate sample variants, using the category tree and adds those variants to the productmodel.- Parameters:
baseProductModel- the product to generate variants fordimension- the amount of dimensions to create- Returns:
- the amount of variants created
-
createCategoriyModelTree
public static List<List<CategoryModel>> createCategoriyModelTree(int dimension, Map<String, List<String>> categoryNamesMap) Creates the structure of the categories and value categories. -
multiplyPermutations
public static List<List<CategoryModel>> multiplyPermutations(List<List<CategoryModel>> allPermutations, List<CategoryModel> valueCategories) Combines the lists of generated values this way: If allPermutations = [[1,2],[1,3]] and valueCategories = [4,5] the result is = [[1,2,4],[1,3,4],[1,2,5],[1,3,5]]- Parameters:
allPermutations- the existing PermutationsvalueCategories- the new Permutation elements to be combined- Returns:
- the total set of Permutations posible.
-
mockNewVariantModel
public static GenericVariantProductModel mockNewVariantModel(ProductModel baseProductModel, List<CategoryModel> valueCategories, int id) -
mockNewVariantProductModelWithVariantsAndValueCategories
-
mockProductDataWithTree
-
mockNewProductModel
-
mockNewValueCategory
public static VariantValueCategoryModel mockNewValueCategory(VariantCategoryModel parentCategory, int sequence, String valueCategoryName) -
getIndent
-