Class PriceList
- All Implemented Interfaces:
 com.broadleafcommerce.data.tracking.core.ContextStateAware,Serializable,Comparable<PriceList>
 Abstraction of an aggregation of prices for PriceableTargets the applicability of
 which is determined by a set of criteria targeting information provided in a PriceContext.
 These criteria include:
 
- a date range for when this price list should be active,
 - a currency code
 - a set of specific 
UserTargets - Expressions targeting the web request
 - Expressions targeting general user (e.g., customer or account) attributes
 - Generic expression targeting 
PriceContextfields 
 Price lists can either aggregate PriceData for individual PriceableTargets or
 use a broader, generalized PriceModifier that operates on base priceable fields or prices
 provided by other price lists. (For example, a PriceListType.SALE price list
 can modify the price provided by a PriceListType.STANDARD price list.)
 
 Some price lists can also be given priority over others of the same price list type.
 This allows ties to be broken when more than one price list applies to a given price context,
 primarily used with PriceListType.STANDARD price lists.
 
- Author:
 - Nathan Moore (nathanmoore)
 - See Also:
 
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionprotected booleanintCompares first by priority then by id if equal.booleanDefines the ending time for which this price list is activeDefines the beginning time for which this price list is active.com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextStateA subset ofTrackinginformation to expose the context state for this object.javax.money.CurrencyUnitThe currency to which this price list applies.getId()Fields that modifiers can modify for this price list.getName()String expression used to determine whether a price list applies to aPriceContext.Optionally describes how this price list will modify existing prices.When multiple price lists match aPriceContext, the price list with the higher priority wins out, where smaller integer values represent higher priorities.Key to external system indicating that this PriceList is specific to a store.getType()Specific users that this price list targets.Key to external system indicating that this PriceList is specific to a vendor.inthashCode()booleanisActive()Whether this PriceInfo is active based on theactiveStartDateandactiveEndDate.booleanA flag determining whether vendors are allowed to view this price list or add vendor price data to it.booleanWhether this price list uses a price modifier instead of price datavoidsetActiveEndDate(Instant activeEndDate) Defines the ending time for which this price list is activevoidsetActiveStartDate(Instant activeStartDate) Defines the beginning time for which this price list is active.voidsetAllowVendorsToAddPriceData(boolean allowVendorsToAddPriceData) A flag determining whether vendors are allowed to view this price list or add vendor price data to it.voidsetContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTrackinginformation to expose the context state for this object.voidsetCurrency(javax.money.CurrencyUnit currency) The currency to which this price list applies.voidvoidsetModifiableFields(Set<String> modifiableFields) Fields that modifiers can modify for this price list.voidvoidsetPriceContextCriteria(String priceContextCriteria) String expression used to determine whether a price list applies to aPriceContext.voidsetPriceModifier(PriceModifier priceModifier) Optionally describes how this price list will modify existing prices.voidsetPriority(Integer priority) When multiple price lists match aPriceContext, the price list with the higher priority wins out, where smaller integer values represent higher priorities.voidsetStoreRef(String storeRef) Key to external system indicating that this PriceList is specific to a store.voidvoidsetUseModifier(boolean useModifier) Whether this price list uses a price modifier instead of price datavoidsetUserTargets(Set<UserTarget> userTargets) Specific users that this price list targets.voidsetVendorRef(String vendorRef) Key to external system indicating that this PriceList is specific to a vendor.toString() 
- 
Constructor Details
- 
PriceList
public PriceList() 
 - 
 - 
Method Details
- 
compareTo
Compares first by priority then by id if equal. Null is greater than not null.- Specified by:
 compareToin interfaceComparable<PriceList>
 - 
isActive
public boolean isActive()Whether this PriceInfo is active based on theactiveStartDateandactiveEndDate. - 
getId
 - 
getName
 - 
getActiveStartDate
Defines the beginning time for which this price list is active. - 
getActiveEndDate
Defines the ending time for which this price list is active - 
getCurrency
public javax.money.CurrencyUnit getCurrency()The currency to which this price list applies. - 
getType
- See Also:
 
 - 
getPriority
When multiple price lists match aPriceContext, the price list with the higher priority wins out, where smaller integer values represent higher priorities. Nulls are implicitly given lower precedence than any other value - they will appear last. - 
getPriceContextCriteria
String expression used to determine whether a price list applies to aPriceContext. This could be a string representation of aSpelExpression, e.g.,name == 'some-name' || id == '1', or that of some other expression language. - 
getUserTargets
Specific users that this price list targets. Expects an ID and a type of user. This could include such types as "customer" or "account". - 
isUseModifier
public boolean isUseModifier()Whether this price list uses a price modifier instead of price data - 
getPriceModifier
Optionally describes how this price list will modify existing prices. - 
getModifiableFields
Fields that modifiers can modify for this price list.
Modifiable fields for each type:
- Standard Price Lists:
 - 
             Sale Price Lists:
             
PriceableFieldProperties.basePricePriceableFieldProperties.baseCost- Standard Price List price (standardPrice)
 
 - 
             Contract Price Lists:
             
PriceableFieldProperties.basePricePriceableFieldProperties.baseCost- Standard Price List price (standardPrice)
 - Sale Price List price (salePrice)
 
 
 - 
getContextState
public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()A subset ofTrackinginformation to expose the context state for this object.- Specified by:
 getContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware- Returns:
 - a subset of 
Trackinginformation to expose the context state for this object 
 - 
getVendorRef
Key to external system indicating that this PriceList is specific to a vendor. This can be populated to support security controls based on a vendor based claim.- Returns:
 - the vendor reference
 
 - 
getStoreRef
Key to external system indicating that this PriceList is specific to a store. This can be populated to support security controls based on a store based claim.- Returns:
 - the store reference
 
 - 
isAllowVendorsToAddPriceData
public boolean isAllowVendorsToAddPriceData()A flag determining whether vendors are allowed to view this price list or add vendor price data to it. This is most relevant to price lists which are themselves not in a vendor but want to control whether vendors can contribute to them. - 
setId
 - 
setName
 - 
setActiveStartDate
Defines the beginning time for which this price list is active. - 
setActiveEndDate
Defines the ending time for which this price list is active - 
setCurrency
public void setCurrency(javax.money.CurrencyUnit currency) The currency to which this price list applies. - 
setType
- See Also:
 
 - 
setPriority
When multiple price lists match aPriceContext, the price list with the higher priority wins out, where smaller integer values represent higher priorities. Nulls are implicitly given lower precedence than any other value - they will appear last. - 
setPriceContextCriteria
String expression used to determine whether a price list applies to aPriceContext. This could be a string representation of aSpelExpression, e.g.,name == 'some-name' || id == '1', or that of some other expression language. - 
setUserTargets
Specific users that this price list targets. Expects an ID and a type of user. This could include such types as "customer" or "account". - 
setUseModifier
public void setUseModifier(boolean useModifier) Whether this price list uses a price modifier instead of price data - 
setPriceModifier
Optionally describes how this price list will modify existing prices. - 
setModifiableFields
Fields that modifiers can modify for this price list.
Modifiable fields for each type:
- Standard Price Lists:
 - 
             Sale Price Lists:
             
PriceableFieldProperties.basePricePriceableFieldProperties.baseCost- Standard Price List price (standardPrice)
 
 - 
             Contract Price Lists:
             
PriceableFieldProperties.basePricePriceableFieldProperties.baseCost- Standard Price List price (standardPrice)
 - Sale Price List price (salePrice)
 
 
 - 
setContextState
public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTrackinginformation to expose the context state for this object.- Specified by:
 setContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware- Parameters:
 contextState- a subset ofTrackinginformation to expose the context state for this object
 - 
setVendorRef
Key to external system indicating that this PriceList is specific to a vendor. This can be populated to support security controls based on a vendor based claim.- Parameters:
 vendorRef- a reference to a vendor (e.g. vendorId or vendorCode)
 - 
setStoreRef
Key to external system indicating that this PriceList is specific to a store. This can be populated to support security controls based on a store based claim.- Parameters:
 storeRef- a reference to a store (e.g. storeId or storeCode)
 - 
setAllowVendorsToAddPriceData
public void setAllowVendorsToAddPriceData(boolean allowVendorsToAddPriceData) A flag determining whether vendors are allowed to view this price list or add vendor price data to it. This is most relevant to price lists which are themselves not in a vendor but want to control whether vendors can contribute to them. - 
equals
 - 
canEqual
 - 
hashCode
public int hashCode() - 
toString
 
 -