Class VariantMatrixFactoryUtil
- java.lang.Object
-
- de.hybris.platform.commercefacades.product.converters.populator.VariantMatrixFactoryUtil
-
public class VariantMatrixFactoryUtil extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBASE_PRODUCT_CODEstatic java.util.Map<java.lang.String,java.util.List<java.lang.String>>categoryNamesMapstatic java.lang.StringCOLORstatic java.lang.StringDIMENSION4static java.lang.StringDIMENSION5static java.lang.StringDIMENSION6static java.lang.String[]dimensionsstatic java.lang.StringFITstatic java.lang.StringSIZE
-
Constructor Summary
Constructors Constructor Description VariantMatrixFactoryUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intaddVariantsWithValueCategories(ProductModel baseProductModel, int dimension)Generate sample variants, using the category tree and adds those variants to the productmodel.static java.util.List<java.util.List<CategoryModel>>createCategoriyModelTree(int dimension, java.util.Map<java.lang.String,java.util.List<java.lang.String>> categoryNamesMap)Creates the structure of the categories and value categories.protected static java.lang.StringgetIndent(int level)static ProductModelmockNewProductModel()static VariantValueCategoryModelmockNewValueCategory(VariantCategoryModel parentCategory, int sequence, java.lang.String valueCategoryName)static GenericVariantProductModelmockNewVariantModel(ProductModel baseProductModel, java.util.List<CategoryModel> valueCategories, int id)static ProductModelmockNewVariantProductModelWithVariantsAndValueCategories(int dimension)static ProductDatamockProductDataWithTree(ProductModel firstVariant)static java.util.List<java.util.List<CategoryModel>>multiplyPermutations(java.util.List<java.util.List<CategoryModel>> allPermutations, java.util.List<CategoryModel> valueCategories)Combines the lists of generated values this way:
-
-
-
Field Detail
-
BASE_PRODUCT_CODE
public static final java.lang.String BASE_PRODUCT_CODE
- See Also:
- Constant Field Values
-
FIT
public static final java.lang.String FIT
- See Also:
- Constant Field Values
-
COLOR
public static final java.lang.String COLOR
- See Also:
- Constant Field Values
-
SIZE
public static final java.lang.String SIZE
- See Also:
- Constant Field Values
-
DIMENSION4
public static final java.lang.String DIMENSION4
- See Also:
- Constant Field Values
-
DIMENSION5
public static final java.lang.String DIMENSION5
- See Also:
- Constant Field Values
-
DIMENSION6
public static final java.lang.String DIMENSION6
- See Also:
- Constant Field Values
-
dimensions
public static final java.lang.String[] dimensions
-
categoryNamesMap
public static final java.util.Map<java.lang.String,java.util.List<java.lang.String>> categoryNamesMap
-
-
Method Detail
-
addVariantsWithValueCategories
public static int addVariantsWithValueCategories(ProductModel baseProductModel, int dimension)
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 java.util.List<java.util.List<CategoryModel>> createCategoriyModelTree(int dimension, java.util.Map<java.lang.String,java.util.List<java.lang.String>> categoryNamesMap)
Creates the structure of the categories and value categories.
-
multiplyPermutations
public static java.util.List<java.util.List<CategoryModel>> multiplyPermutations(java.util.List<java.util.List<CategoryModel>> allPermutations, java.util.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, java.util.List<CategoryModel> valueCategories, int id)
-
mockNewVariantProductModelWithVariantsAndValueCategories
public static ProductModel mockNewVariantProductModelWithVariantsAndValueCategories(int dimension)
-
mockProductDataWithTree
public static ProductData mockProductDataWithTree(ProductModel firstVariant)
-
mockNewProductModel
public static ProductModel mockNewProductModel()
-
mockNewValueCategory
public static VariantValueCategoryModel mockNewValueCategory(VariantCategoryModel parentCategory, int sequence, java.lang.String valueCategoryName)
-
getIndent
protected static java.lang.String getIndent(int level)
-
-