Interface ScopedPrice

All Superinterfaces:
Customizable<ScopedPrice>

public interface ScopedPrice extends Customizable<ScopedPrice>

Scoped Price is contained in a ProductVariant which is returned in response to a Product Projection Search request when Scoped Price Search is used.


Example to create an instance using the builder pattern

     ScopedPrice scopedPrice = ScopedPrice.builder()
             .id("{id}")
             .value(valueBuilder -> valueBuilder)
             .currentValue(currentValueBuilder -> currentValueBuilder)
             .build()
 
  • Method Details

    • getId

      @NotNull @NotNull String getId()

      Platform-generated unique identifier of the Price.

      Returns:
      id
    • getValue

      @NotNull @Valid @NotNull @Valid TypedMoney getValue()

      Original value of the Price.

      Returns:
      value
    • getCurrentValue

      @NotNull @Valid @NotNull @Valid TypedMoney getCurrentValue()

      If available, either the original price value or discounted value.

      Returns:
      currentValue
    • getCountry

      String getCountry()

      Country code of the geographic location.

      Returns:
      country
    • getCustomerGroup

      @Valid @Valid CustomerGroupReference getCustomerGroup()

      Reference to a CustomerGroup.

      Returns:
      customerGroup
    • getChannel

      @Valid @Valid ChannelReference getChannel()

      Reference to a Channel.

      Returns:
      channel
    • getValidFrom

      ZonedDateTime getValidFrom()

      Date and time from which the Price is valid.

      Returns:
      validFrom
    • getValidUntil

      ZonedDateTime getValidUntil()

      Date and time until which the Price is valid.

      Returns:
      validUntil
    • getDiscounted

      @Valid @Valid DiscountedPrice getDiscounted()

      Is set when a matching ProductDiscount exists. If set, the Cart uses the discounted value for the Cart Price calculation.

      When a relative Product Discount is applied and the fractional part of the discounted Price is 0.5, the discounted Price is rounded half down in favor of the Customer.

      Returns:
      discounted
    • getCustom

      @Valid @Valid CustomFields getCustom()

      Custom Fields for the Price.

      Specified by:
      getCustom in interface Customizable<ScopedPrice>
      Returns:
      custom
    • setId

      void setId(String id)

      Platform-generated unique identifier of the Price.

      Parameters:
      id - value to be set
    • setValue

      void setValue(TypedMoney value)

      Original value of the Price.

      Parameters:
      value - value to be set
    • setCurrentValue

      void setCurrentValue(TypedMoney currentValue)

      If available, either the original price value or discounted value.

      Parameters:
      currentValue - value to be set
    • setCountry

      void setCountry(String country)

      Country code of the geographic location.

      Parameters:
      country - value to be set
    • setCustomerGroup

      void setCustomerGroup(CustomerGroupReference customerGroup)

      Reference to a CustomerGroup.

      Parameters:
      customerGroup - value to be set
    • setChannel

      void setChannel(ChannelReference channel)

      Reference to a Channel.

      Parameters:
      channel - value to be set
    • setValidFrom

      void setValidFrom(ZonedDateTime validFrom)

      Date and time from which the Price is valid.

      Parameters:
      validFrom - value to be set
    • setValidUntil

      void setValidUntil(ZonedDateTime validUntil)

      Date and time until which the Price is valid.

      Parameters:
      validUntil - value to be set
    • setDiscounted

      void setDiscounted(DiscountedPrice discounted)

      Is set when a matching ProductDiscount exists. If set, the Cart uses the discounted value for the Cart Price calculation.

      When a relative Product Discount is applied and the fractional part of the discounted Price is 0.5, the discounted Price is rounded half down in favor of the Customer.

      Parameters:
      discounted - value to be set
    • setCustom

      void setCustom(CustomFields custom)

      Custom Fields for the Price.

      Specified by:
      setCustom in interface Customizable<ScopedPrice>
      Parameters:
      custom - value to be set
    • of

      static ScopedPrice of()
      factory method
      Returns:
      instance of ScopedPrice
    • of

      static ScopedPrice of(ScopedPrice template)
      factory method to create a shallow copy ScopedPrice
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static ScopedPrice deepCopy(@Nullable ScopedPrice template)
      factory method to create a deep copy of ScopedPrice
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static ScopedPriceBuilder builder()
      builder factory method for ScopedPrice
      Returns:
      builder
    • builder

      static ScopedPriceBuilder builder(ScopedPrice template)
      create builder for ScopedPrice instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withScopedPrice

      default <T> T withScopedPrice(Function<ScopedPrice,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<ScopedPrice> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference