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 boolean
boolean
fromPriceContext
(PriceContext source) Takes in a price context and merges it into the this.Additional, unspecified attributes.javax.money.CurrencyUnit
The currency by which to retrieve pricing info.TheLocale
used in this contextUserTargetRefs
associated with the API request.int
hashCode()
void
setAttributes
(Map<String, Object> attributes) Additional, unspecified attributes.void
setCurrency
(javax.money.CurrencyUnit currency) The currency by which to retrieve pricing info.void
TheLocale
used in this contextvoid
setUserTargets
(Set<UserTargetRef> userTargets) UserTargetRefs
associated 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
TheLocale
used in this context -
getCurrency
public javax.money.CurrencyUnit getCurrency()The currency by which to retrieve pricing info.- Specified by:
getCurrency
in interfacejavax.money.CurrencySupplier
-
getUserTargets
UserTargetRefs
associated with the API request. -
getAttributes
Additional, unspecified attributes. -
setLocale
TheLocale
used in this context -
setCurrency
public void setCurrency(javax.money.CurrencyUnit currency) The currency by which to retrieve pricing info.- Specified by:
setCurrency
in interfacecom.broadleafcommerce.money.CurrencyConsumer
-
setUserTargets
UserTargetRefs
associated with the API request. -
setAttributes
Additional, unspecified attributes. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-