Class LiteVariant
java.lang.Object
com.broadleafcommerce.catalogbrowse.domain.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 Browse Service 2.2.0, Release Train 2.3.0
- Author:
- Susana Cruz (susanaccruz)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(String name, Object value) Takes in any additional attributes passed in the request not matching any defined properties.protected booleanbooleanReturn any additional attributes passed in the request not matching any defined properties.High-level inventory availability details for the specific SKU of the variant.getId()The unique identifier for this variant.Map of option attribute names to a corresponding option value.The link to the product that this variant is associated withgetSku()SKU code for this particular variant.inthashCode()voidsetAttributes(Map<String, Object> attributes) Map holding any additional attributes passed in the request not matching any defined properties.voidsetAvailabilitySummary(SkuInventoryAvailabilitySummary availabilitySummary) High-level inventory availability details for the specific SKU of the variant.voidThe unique identifier for this variant.voidsetOptionValues(Map<String, String> optionValues) Map of option attribute names to a corresponding option value.voidsetProductId(String productId) The link to the product that this variant is associated withvoidSKU code for this particular variant.toString()
-
Constructor Details
-
LiteVariant
public LiteVariant()
-
-
Method Details
-
addAttribute
Takes in any additional attributes passed in the request not matching any defined properties.- Parameters:
name- Name of the additional attributevalue- Value of the additional attribute
-
getAttributes
Return any additional attributes passed in the request not matching any defined properties.- Returns:
- any additional attributes passed in the request not matching any defined properties.
-
getId
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
Map of option attribute names to a corresponding option value. This makes a particular variant uniquely identifiable across multiple variants for the same product.- Returns:
- a map of option attribute names to a corresponding option value
-
getAvailabilitySummary
High-level inventory availability details for the specific SKU of the variant.- Returns:
- a summary of inventory availability for the specific SKU of the variant.
-
setId
The unique identifier for this variant.- Parameters:
id- 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
Map of option attribute names to a corresponding option value. This makes a particular variant uniquely identifiable across multiple variants for the same product.- Parameters:
optionValues- a map of option attribute names to a corresponding option value
-
setAvailabilitySummary
High-level inventory availability details for the specific SKU of the variant.- Parameters:
availabilitySummary- a summary of inventory availability for the specific SKU of the variant.
-
setAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-