Class Variant
java.lang.Object
com.broadleafcommerce.catalogbrowse.domain.Variant
- All Implemented Interfaces:
Priceable,Serializable
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.
- Author:
- Nathan Moore (nathandmoore)
- 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.Map holding any additional attributes passed in the request not matching any defined properties.A summary of inventory availability for this product's SKU.javax.money.MonetaryAmountThe default price that should be used if there is not asalePriceset.getId()The unique identifier for this variant.Describes when the variant's inventory should be checked for availability.Describes when the variant's inventory should be reserved.The maximum count of this variant can be added in a cart.The minimum count of this variant that must be added in a cart.com.broadleafcommerce.pricing.client.domain.PriceInfoSummary of thepricing informationrelated to the variant.javax.money.MonetaryAmountIndicates that this product is on sale.getSku()Sku code for this particular variant.Soft reference to the vendor associated with this catalog.inthashCode()voidsetAttributes(Map<String, Object> attributes) Map holding any additional attributes passed in the request not matching any defined properties.voidsetAvailabilitySummary(SkuInventoryAvailabilitySummary availabilitySummary) A summary of inventory availability for this product's SKU.voidsetDefaultPrice(javax.money.MonetaryAmount defaultPrice) The default price that should be used if there is not asalePriceset.voidThe unique identifier for this variant.voidsetInventoryCheckStrategy(String inventoryCheckStrategy) Describes when the variant's inventory should be checked for availability.voidsetInventoryReservationStrategy(String inventoryReservationStrategy) Describes when the variant's inventory should be reserved.voidsetMaximumThreshold(Integer maximumThreshold) The maximum count of this variant can be added in a cart.voidsetMinimumThreshold(Integer minimumThreshold) The minimum count of this variant that must be added in a cart.voidsetPriceInfo(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo) Summary of thepricing informationrelated to the variant.voidsetSalePrice(javax.money.MonetaryAmount salePrice) Indicates that this product is on sale.voidSku code for this particular variant.voidsetVendorRef(String vendorRef) Soft reference to the vendor associated with this catalog.toString()
-
Constructor Details
-
Variant
public Variant()
-
-
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
-
getAttribute
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
-
getSku
Sku code for this particular variant. Overrides the main Product Sku that is set, if any- Returns:
- the SKU code for this variant
-
getPriceInfo
public com.broadleafcommerce.pricing.client.domain.PriceInfo getPriceInfo()Summary of thepricing informationrelated to the variant.- Specified by:
getPriceInfoin interfacePriceable- Returns:
- The
PriceInfoon the entity.
-
getDefaultPrice
public javax.money.MonetaryAmount getDefaultPrice()The default price that should be used if there is not asalePriceset. If this price is not set, product's price would be used.- Returns:
- the default price to be used for this variant
-
getSalePrice
public javax.money.MonetaryAmount getSalePrice()Indicates that this product is on sale. This should take priority over the default price if the default price is higher- Returns:
- the sale price of this variant, indicating it is on sale
-
getVendorRef
Soft reference to the vendor associated with this catalog. This value can be null, in which case, no vendor is associated.- Returns:
- Soft reference to the vendor associated with this catalog.
-
getMinimumThreshold
The minimum count of this variant that must be added in a cart.- Returns:
- the minimum count of this variant that must be added in a cart
-
getMaximumThreshold
The maximum count of this variant can be added in a cart.- Returns:
- the maximum count of this variant can be added in a cart
-
getInventoryCheckStrategy
Describes when the variant's inventory should be checked for availability. If not set, defaults toProduct.getInventoryCheckStrategy().- Returns:
- the inventory check strategy, or null.
-
getInventoryReservationStrategy
Describes when the variant's inventory should be reserved. If not set, defaults toProduct.getInventoryReservationStrategy().- Returns:
- the inventory reservation strategy, or null.
-
getAvailabilitySummary
A summary of inventory availability for this product's SKU. -
getAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
setId
The unique identifier for this variant.- Parameters:
id- the context ID of the variant
-
setSku
Sku code for this particular variant. Overrides the main Product Sku that is set, if any- Parameters:
sku- the SKU code for this variant
-
setPriceInfo
public void setPriceInfo(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo) Summary of thepricing informationrelated to the variant.- Specified by:
setPriceInfoin interfacePriceable- Parameters:
priceInfo- ThePriceInfoto set.
-
setDefaultPrice
public void setDefaultPrice(javax.money.MonetaryAmount defaultPrice) The default price that should be used if there is not asalePriceset. If this price is not set, product's price would be used.- Parameters:
defaultPrice- the default price to be used for this variant
-
setSalePrice
public void setSalePrice(javax.money.MonetaryAmount salePrice) Indicates that this product is on sale. This should take priority over the default price if the default price is higher- Parameters:
salePrice- the sale price of this variant, indicating it is on sale
-
setVendorRef
Soft reference to the vendor associated with this catalog. This value can be null, in which case, no vendor is associated.- Parameters:
vendorRef- Soft reference to the vendor associated with this catalog.
-
setMinimumThreshold
The minimum count of this variant that must be added in a cart.- Parameters:
minimumThreshold- the minimum count of this variant that must be added in a cart
-
setMaximumThreshold
The maximum count of this variant can be added in a cart.- Parameters:
maximumThreshold- the maximum count of this variant can be added in a cart
-
setInventoryCheckStrategy
Describes when the variant's inventory should be checked for availability. If not set, defaults toProduct.getInventoryCheckStrategy().- Parameters:
inventoryCheckStrategy- The inventoryCheckStrategy if/when inventory should be checked, usually during browsing
-
setInventoryReservationStrategy
Describes when the variant's inventory should be reserved. If not set, defaults toProduct.getInventoryReservationStrategy().- Parameters:
inventoryReservationStrategy- the strategy for reserving inventory
-
setAvailabilitySummary
A summary of inventory availability for this product's SKU. -
setAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-