public interface VariantsService
| Modifier and Type | Method and Description |
|---|---|
java.util.Collection<VariantTypeModel> |
getAllVariantTypes()
Searches all existing variant types.
|
java.util.Map<java.lang.String,java.util.Collection<java.lang.Object>> |
getAssignedVariantAttributes(ProductModel baseProduct)
Searches variant attributes with all assigned values for given base product.
|
java.util.Set<java.lang.String> |
getVariantAttributes(java.lang.String variantProductType)
Returns a set of variant attribute qualifiers for the given
variantProductType. |
java.util.List<VariantAttributeDescriptorModel> |
getVariantAttributesForVariantType(VariantTypeModel variantType)
Returns the attribute descriptors of the given
VariantType. |
java.lang.Object |
getVariantAttributeValue(VariantProductModel variant,
java.lang.String qualifier)
Returns for the given
VariantProductModel and given attribute qualifier the value of this
attribute. |
java.util.Collection<VariantProductModel> |
getVariantProductForAttributeValues(ProductModel baseProduct,
java.util.Map<java.lang.String,java.lang.Object> filterValues)
Filters a range of variants from a given base product according to the given variant attribute qualifier-value
map.
|
VariantTypeModel |
getVariantTypeForCode(java.lang.String code)
Returns a
VariantTypeModel instance for the given code. |
void |
setVariantAttributesForVariantType(VariantTypeModel variantType,
java.util.List<VariantAttributeDescriptorModel> newAttributes)
Tries to assign new variant attribute descriptors for the given variant type.
|
void |
setVariantAttributeValue(VariantProductModel variant,
java.lang.String qualifier,
java.lang.Object value)
|
VariantTypeModel getVariantTypeForCode(java.lang.String code)
VariantTypeModel instance for the given code.code - the variant type code. Must exists in the system and must be not null.UnknownIdentifierException - if there is no VariantTypeModel for given codejava.lang.IllegalArgumentException - if given code is nulljava.util.Set<java.lang.String> getVariantAttributes(java.lang.String variantProductType)
variantProductType.variantProductType - the variant type code. Must exists in the system and must be a variant type.variantProductType no variant attributes were found.UnknownIdentifierException - if the given variantProductType does not exists or is not a variant typejava.lang.Object getVariantAttributeValue(VariantProductModel variant, java.lang.String qualifier)
VariantProductModel and given attribute qualifier the value of this
attribute.variant - the variant productqualifier - the attribute qualifierSystemException - if the attribute couldn't be readvoid setVariantAttributeValue(VariantProductModel variant, java.lang.String qualifier, java.lang.Object value)
variant - the variant productqualifier - the attribute qualifiervalue - the value to be setSystemException - if the attribute couldn't be writtenjava.util.Collection<VariantTypeModel> getAllVariantTypes()
java.util.Map<java.lang.String,java.util.Collection<java.lang.Object>> getAssignedVariantAttributes(ProductModel baseProduct)
baseProduct - the base product for all variantsjava.util.Collection<VariantProductModel> getVariantProductForAttributeValues(ProductModel baseProduct, java.util.Map<java.lang.String,java.lang.Object> filterValues)
baseProduct - the base product to get variants forfilterValues - the variant attribute values (attribute qualifier->value map) to match. if null or empty an
empty List will be returned.java.util.List<VariantAttributeDescriptorModel> getVariantAttributesForVariantType(VariantTypeModel variantType)
VariantType.variantType - the variant typevoid setVariantAttributesForVariantType(VariantTypeModel variantType, java.util.List<VariantAttributeDescriptorModel> newAttributes)
VariantAttributeDescriptorModels.variantType - the variant typenewAttributes - the attributes which should be assignedjava.lang.IllegalArgumentException - if given variantType is newCopyright © 2018 SAP SE. All Rights Reserved.