public class Variant extends Object implements Serializable, com.broadleafcommerce.money.jackson.CurrencyContextAware
Variants can help further identify the specifics of a Product by narrowing down the Sku via * additional user data.
* Variants are only intended to be accessed within the context of a Product
and only *
provide a link to the Product
it is apart of because of this.
Constructor and Description |
---|
Variant() |
Modifier and Type | Method and Description |
---|---|
void |
addAdditionalAttribute(String name,
Object value)
Takes in any additional attributes passed in the request not matching any defined properties.
|
protected boolean |
canEqual(Object other) |
boolean |
equals(Object o) |
Map<String,Object> |
getAdditionalAttribute()
Return any additional attributes passed in the request not matching any defined properties.
|
Map<String,Object> |
getAdditionalAttributes()
Map holding any additional attributes passed in the request not matching any defined
properties.
|
Map<String,Serializable> |
getAttributes()
Dynamic attributes that are a part of the variant.
|
com.broadleafcommerce.money.CurrencyContext |
getCurrencyContext()
Transient ability to have a currency initialized
|
Map<String,FulfillmentFlatRate> |
getFulfillmentFlatRates()
A map of flat rates for fulfilling (e.g., shipping) this product for a particular fulfillment
option type (e.g., standard shipping).
|
String |
getId()
The unique identifier for this variant.
|
String |
getInventoryCheckStrategy()
Describes when the variant's inventory should be checked for availability.
|
String |
getInventoryReservationStrategy()
Describes when the variant's inventory should be reserved.
|
Integer |
getMaximumThreshold()
The maximum count of this variant can be added in a cart.
|
Integer |
getMinimumThreshold()
The minimum count of this variant that must be added in a cart.
|
String |
getName()
The name of this particular variant of the product.
|
Map<String,String> |
getOptionValues()
Helper to make this particular variant uniquely identifiable across multiple variants for the
same product.
|
com.broadleafcommerce.pricing.client.domain.PriceInfo |
getPriceInfo()
Summary of the
pricing information related to the choice. |
String |
getSku()
Sku code for this particular variant.
|
Weight |
getWeight() |
int |
hashCode() |
void |
setAdditionalAttributes(Map<String,Object> additionalAttributes)
Map holding any additional attributes passed in the request not matching any defined
properties.
|
void |
setAttributes(Map<String,Serializable> attributes)
Dynamic attributes that are a part of the variant.
|
void |
setCurrencyContext(com.broadleafcommerce.money.CurrencyContext currencyContext)
Transient ability to have a currency initialized
|
void |
setFulfillmentFlatRates(Map<String,FulfillmentFlatRate> fulfillmentFlatRates)
A map of flat rates for fulfilling (e.g., shipping) this product for a particular fulfillment
option type (e.g., standard shipping).
|
void |
setId(String id)
The unique identifier for this variant.
|
void |
setInventoryCheckStrategy(String inventoryCheckStrategy)
Describes when the variant's inventory should be checked for availability.
|
void |
setInventoryReservationStrategy(String inventoryReservationStrategy)
Describes when the variant's inventory should be reserved.
|
void |
setMaximumThreshold(Integer maximumThreshold)
The maximum count of this variant can be added in a cart.
|
void |
setMinimumThreshold(Integer minimumThreshold)
The minimum count of this variant that must be added in a cart.
|
void |
setName(String name)
The name of this particular variant of the product.
|
void |
setOptionValues(Map<String,String> optionValues)
Helper to make this particular variant uniquely identifiable across multiple variants for the
same product.
|
void |
setPriceInfo(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo)
Summary of the
pricing information related to the choice. |
void |
setSku(String sku)
Sku code for this particular variant.
|
void |
setWeight(Weight weight) |
String |
toString() |
public void addAdditionalAttribute(String name, Object value)
name
- Name of the additional attributevalue
- Value of the additional attributepublic Map<String,Object> getAdditionalAttribute()
public String getId()
public String getSku()
public String getName()
public com.broadleafcommerce.pricing.client.domain.PriceInfo getPriceInfo()
pricing information
related to the choice.pricing information
related to the choicepublic Map<String,String> getOptionValues()
AttributeChoice.getAttributeName()
while values
correspond to one of the corresponding AttributeChoice.getAttributeName()
.option attribute names
to a
corresponding option value
public String getInventoryCheckStrategy()
Product.inventoryCheckStrategy
.public String getInventoryReservationStrategy()
Product.inventoryReservationStrategy
.public Integer getMinimumThreshold()
public Integer getMaximumThreshold()
public Map<String,FulfillmentFlatRate> getFulfillmentFlatRates()
The key of the map is the type of the fulfillment option such as FIXED_STANDARD
or
BANDED_PRICE_EXPRESS
.
FulfillmentFlatRate
public Weight getWeight()
public Map<String,Serializable> getAttributes()
public com.broadleafcommerce.money.CurrencyContext getCurrencyContext()
getCurrencyContext
in interface com.broadleafcommerce.money.jackson.CurrencyContextAware
public Map<String,Object> getAdditionalAttributes()
public void setId(String id)
id
- the context ID of the variantpublic void setSku(String sku)
sku
- the SKU code for this variantpublic void setName(String name)
name
- the name of this variantpublic void setPriceInfo(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo)
pricing information
related to the choice.priceInfo
- Summary of the pricing information
related to the choicepublic void setOptionValues(Map<String,String> optionValues)
AttributeChoice.getAttributeName()
while values
correspond to one of the corresponding AttributeChoice.getAttributeName()
.optionValues
- a map of option attribute
names
to a corresponding option value
public void setInventoryCheckStrategy(String inventoryCheckStrategy)
Product.inventoryCheckStrategy
.inventoryCheckStrategy
- the variant's inventory check strategypublic void setInventoryReservationStrategy(String inventoryReservationStrategy)
Product.inventoryReservationStrategy
.inventoryReservationStrategy
- the variant's inventory reservation strategypublic void setMinimumThreshold(Integer minimumThreshold)
minimumThreshold
- the minimum count of this variant that must be added in a cartpublic void setMaximumThreshold(Integer maximumThreshold)
maximumThreshold
- the maximum count of this variant can be added in a cartpublic void setFulfillmentFlatRates(Map<String,FulfillmentFlatRate> fulfillmentFlatRates)
The key of the map is the type of the fulfillment option such as FIXED_STANDARD
or
BANDED_PRICE_EXPRESS
.
fulfillmentFlatRates
- Map of Fulfillment option types to flat rates for this product.FulfillmentFlatRate
public void setWeight(Weight weight)
weight
- the weight of this variantpublic void setAttributes(Map<String,Serializable> attributes)
attributes
- dynamic attributes that are a part of the variantpublic void setCurrencyContext(com.broadleafcommerce.money.CurrencyContext currencyContext)
setCurrencyContext
in interface com.broadleafcommerce.money.jackson.CurrencyContextAware
public void setAdditionalAttributes(Map<String,Object> additionalAttributes)
protected boolean canEqual(Object other)
Copyright © 2021. All rights reserved.