Class ScopedPriceImpl

java.lang.Object
com.commercetools.api.models.common.ScopedPriceImpl
All Implemented Interfaces:
ScopedPrice, Customizable<ScopedPrice>, io.vrap.rmf.base.client.ModelBase

public class ScopedPriceImpl extends Object implements ScopedPrice, io.vrap.rmf.base.client.ModelBase

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

  • Constructor Details

    • ScopedPriceImpl

      public ScopedPriceImpl()
      create empty instance
  • Method Details

    • getId

      public String getId()

      Platform-generated unique identifier of the Price.

      Specified by:
      getId in interface ScopedPrice
      Returns:
      id
    • getValue

      public TypedMoney getValue()

      Original value of the Price.

      Specified by:
      getValue in interface ScopedPrice
      Returns:
      value
    • getCurrentValue

      public TypedMoney getCurrentValue()

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

      Specified by:
      getCurrentValue in interface ScopedPrice
      Returns:
      currentValue
    • getCountry

      public String getCountry()

      Country code of the geographic location.

      Specified by:
      getCountry in interface ScopedPrice
      Returns:
      country
    • getCustomerGroup

      public CustomerGroupReference getCustomerGroup()

      Reference to a CustomerGroup.

      Specified by:
      getCustomerGroup in interface ScopedPrice
      Returns:
      customerGroup
    • getChannel

      public ChannelReference getChannel()

      Reference to a Channel.

      Specified by:
      getChannel in interface ScopedPrice
      Returns:
      channel
    • getValidFrom

      public ZonedDateTime getValidFrom()

      Date and time from which the Price is valid.

      Specified by:
      getValidFrom in interface ScopedPrice
      Returns:
      validFrom
    • getValidUntil

      public ZonedDateTime getValidUntil()

      Date and time until which the Price is valid.

      Specified by:
      getValidUntil in interface ScopedPrice
      Returns:
      validUntil
    • getDiscounted

      public 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.

      Specified by:
      getDiscounted in interface ScopedPrice
      Returns:
      discounted
    • getCustom

      public CustomFields getCustom()

      Custom Fields for the Price.

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

      public void setId(String id)
      Description copied from interface: ScopedPrice

      Platform-generated unique identifier of the Price.

      Specified by:
      setId in interface ScopedPrice
      Parameters:
      id - value to be set
    • setValue

      public void setValue(TypedMoney value)
      Description copied from interface: ScopedPrice

      Original value of the Price.

      Specified by:
      setValue in interface ScopedPrice
      Parameters:
      value - value to be set
    • setCurrentValue

      public void setCurrentValue(TypedMoney currentValue)
      Description copied from interface: ScopedPrice

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

      Specified by:
      setCurrentValue in interface ScopedPrice
      Parameters:
      currentValue - value to be set
    • setCountry

      public void setCountry(String country)
      Description copied from interface: ScopedPrice

      Country code of the geographic location.

      Specified by:
      setCountry in interface ScopedPrice
      Parameters:
      country - value to be set
    • setCustomerGroup

      public void setCustomerGroup(CustomerGroupReference customerGroup)
      Description copied from interface: ScopedPrice

      Reference to a CustomerGroup.

      Specified by:
      setCustomerGroup in interface ScopedPrice
      Parameters:
      customerGroup - value to be set
    • setChannel

      public void setChannel(ChannelReference channel)
      Description copied from interface: ScopedPrice

      Reference to a Channel.

      Specified by:
      setChannel in interface ScopedPrice
      Parameters:
      channel - value to be set
    • setValidFrom

      public void setValidFrom(ZonedDateTime validFrom)
      Description copied from interface: ScopedPrice

      Date and time from which the Price is valid.

      Specified by:
      setValidFrom in interface ScopedPrice
      Parameters:
      validFrom - value to be set
    • setValidUntil

      public void setValidUntil(ZonedDateTime validUntil)
      Description copied from interface: ScopedPrice

      Date and time until which the Price is valid.

      Specified by:
      setValidUntil in interface ScopedPrice
      Parameters:
      validUntil - value to be set
    • setDiscounted

      public void setDiscounted(DiscountedPrice discounted)
      Description copied from interface: ScopedPrice

      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.

      Specified by:
      setDiscounted in interface ScopedPrice
      Parameters:
      discounted - value to be set
    • setCustom

      public void setCustom(CustomFields custom)
      Description copied from interface: ScopedPrice

      Custom Fields for the Price.

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

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

      public int hashCode()
      Overrides:
      hashCode in class Object