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 Details

  • Constructor Details

    • PriceContext

      public PriceContext()
  • Method Details

    • fromPriceContext

      @NonNull public PriceContext fromPriceContext(@Nullable PriceContext source)
      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

      public Locale getLocale()
      The Locale used in this context
    • getCurrency

      public javax.money.CurrencyUnit getCurrency()
      The currency by which to retrieve pricing info.
      Specified by:
      getCurrency in interface javax.money.CurrencySupplier
    • getUserTargets

      public Set<UserTargetRef> getUserTargets()
      UserTargetRefs associated with the API request.
    • getAttributes

      public Map<String,Object> getAttributes()
      Additional, unspecified attributes.
    • setLocale

      public void setLocale(Locale locale)
      The Locale used in this context
    • setCurrency

      public void setCurrency(javax.money.CurrencyUnit currency)
      The currency by which to retrieve pricing info.
      Specified by:
      setCurrency in interface com.broadleafcommerce.money.CurrencyConsumer
    • setUserTargets

      public void setUserTargets(Set<UserTargetRef> userTargets)
      UserTargetRefs associated with the API request.
    • setAttributes

      public void setAttributes(Map<String,Object> attributes)
      Additional, unspecified attributes.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object