Class PriceContext
java.lang.Object
com.broadleafcommerce.pricing.client.domain.context.PriceContext
- All Implemented Interfaces:
com.broadleafcommerce.money.CurrencyConsumer,Serializable,javax.money.CurrencySupplier
public class PriceContext
extends Object
implements Serializable, javax.money.CurrencySupplier, com.broadleafcommerce.money.CurrencyConsumer
DTO for holding data relevant for determining which pricing entities apply to an API request.
- Author:
- Chad Harchar (charchar)
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanfromPriceContext(PriceContext source) Takes in a price context and merges it into the this.Additional, unspecified attributes.javax.money.CurrencyUnitThe currency by which to retrieve pricing info.TheLocaleused in this contextUserTargetRefsassociated with the API request.inthashCode()voidsetAttributes(Map<String, Object> attributes) Additional, unspecified attributes.voidsetCurrency(javax.money.CurrencyUnit currency) The currency by which to retrieve pricing info.voidTheLocaleused in this contextvoidsetUserTargets(Set<UserTargetRef> userTargets) UserTargetRefsassociated with the API request.toString()
-
Field Details
-
PRICE_CONTEXT_HEADER
- See Also:
-
-
Constructor Details
-
PriceContext
public PriceContext()
-
-
Method Details
-
fromPriceContext
Takes in a price context and merges it into the this. Note that, except for collections, any values present in the source price context will override any value in this. Collections will be merged.- Parameters:
source- the price context that gets merged from- Returns:
- this
-
getLocale
TheLocaleused in this context -
getCurrency
public javax.money.CurrencyUnit getCurrency()The currency by which to retrieve pricing info.- Specified by:
getCurrencyin interfacejavax.money.CurrencySupplier
-
getUserTargets
UserTargetRefsassociated with the API request. -
getAttributes
Additional, unspecified attributes. -
setLocale
TheLocaleused in this context -
setCurrency
public void setCurrency(javax.money.CurrencyUnit currency) The currency by which to retrieve pricing info.- Specified by:
setCurrencyin interfacecom.broadleafcommerce.money.CurrencyConsumer
-
setUserTargets
UserTargetRefsassociated with the API request. -
setAttributes
Additional, unspecified attributes. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-