Class LiteVariant
java.lang.Object
com.broadleafcommerce.catalog.domain.product.LiteVariant
- All Implemented Interfaces:
Serializable
A lightweight version of
Variant. This is intended for usage in commerce flows where only
a small subset of data is necessary from the variant. This is used to improve performance and
reduce payload size to the frontend.- Since:
- Catalog Service 2.3.0, Release Train 2.3.0
- Author:
- Susana Cruz (susanaccruz)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanThe unique identifier for this variant.Helper to make this particular variant uniquely identifiable across multiple variants for the same product.The link to the product that this variant is associated withgetSku()SKU code for this particular variant.inthashCode()voidsetContextId(String contextId) The unique identifier for this variant.voidsetOptionValues(Map<String, String> optionValues) Helper to make this particular variant uniquely identifiable across multiple variants for the same product.voidsetProductId(String productId) The link to the product that this variant is associated withvoidSKU code for this particular variant.toString()
-
Constructor Details
-
LiteVariant
-
LiteVariant
public LiteVariant()
-
-
Method Details
-
getContextId
The unique identifier for this variant.- Returns:
- the context ID of the variant
-
getProductId
The link to the product that this variant is associated with- Returns:
- the context ID of the product that this variant is associated with
-
getSku
SKU code for this particular variant.- Returns:
- the SKU code for this variant
-
getOptionValues
Helper to make this particular variant uniquely identifiable across multiple variants for the same product. Keys correspond toAttributeChoice.getAttributeName()while values correspond to one of the correspondingAttributeChoice.getAllowedValues().- Returns:
- a map of option attribute names to a corresponding option value
-
setContextId
The unique identifier for this variant.- Parameters:
contextId- the context ID of the variant
-
setProductId
The link to the product that this variant is associated with- Parameters:
productId- the context ID of the product that this variant is associated with
-
setSku
SKU code for this particular variant.- Parameters:
sku- the SKU code for this variant
-
setOptionValues
Helper to make this particular variant uniquely identifiable across multiple variants for the same product. Keys correspond toAttributeChoice.getAttributeName()while values correspond to one of the correspondingAttributeChoice.getAllowedValues().- Parameters:
optionValues- a map of option attribute names to a corresponding option value
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-