Class StandalonePriceBuilder

java.lang.Object
com.commercetools.api.models.standalone_price.StandalonePriceBuilder
All Implemented Interfaces:
Builder<StandalonePrice>

public class StandalonePriceBuilder extends Object implements Builder<StandalonePrice>
StandalonePriceBuilder
Example to create an instance using the builder pattern

     StandalonePrice standalonePrice = StandalonePrice.builder()
             .id("{id}")
             .version(0.3)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .sku("{sku}")
             .value(valueBuilder -> valueBuilder)
             .active(true)
             .build()
 
  • Constructor Details

    • StandalonePriceBuilder

      public StandalonePriceBuilder()
  • Method Details

    • id

      Unique identifier of the StandalonePrice.

      Parameters:
      id - value to be set
      Returns:
      Builder
    • version

      public StandalonePriceBuilder version(Long version)

      Current version of the StandalonePrice.

      Parameters:
      version - value to be set
      Returns:
      Builder
    • createdAt

      public StandalonePriceBuilder createdAt(ZonedDateTime createdAt)

      Date and time (UTC) the StandalonePrice was initially created.

      Parameters:
      createdAt - value to be set
      Returns:
      Builder
    • lastModifiedAt

      public StandalonePriceBuilder lastModifiedAt(ZonedDateTime lastModifiedAt)

      Date and time (UTC) the StandalonePrice was last updated.

      Parameters:
      lastModifiedAt - value to be set
      Returns:
      Builder
    • lastModifiedBy

      IDs and references that last modified the StandalonePrice.

      Parameters:
      builder - function to build the lastModifiedBy value
      Returns:
      Builder
    • withLastModifiedBy

      IDs and references that last modified the StandalonePrice.

      Parameters:
      builder - function to build the lastModifiedBy value
      Returns:
      Builder
    • lastModifiedBy

      public StandalonePriceBuilder lastModifiedBy(@Nullable LastModifiedBy lastModifiedBy)

      IDs and references that last modified the StandalonePrice.

      Parameters:
      lastModifiedBy - value to be set
      Returns:
      Builder
    • createdBy

      IDs and references that created the StandalonePrice.

      Parameters:
      builder - function to build the createdBy value
      Returns:
      Builder
    • withCreatedBy

      public StandalonePriceBuilder withCreatedBy(Function<CreatedByBuilder,CreatedBy> builder)

      IDs and references that created the StandalonePrice.

      Parameters:
      builder - function to build the createdBy value
      Returns:
      Builder
    • createdBy

      public StandalonePriceBuilder createdBy(@Nullable CreatedBy createdBy)

      IDs and references that created the StandalonePrice.

      Parameters:
      createdBy - value to be set
      Returns:
      Builder
    • key

      User-defined unique identifier of the StandalonePrice.

      Parameters:
      key - value to be set
      Returns:
      Builder
    • sku

      public StandalonePriceBuilder sku(String sku)

      SKU of the ProductVariant to which this Price is associated.

      Parameters:
      sku - value to be set
      Returns:
      Builder
    • value

      public StandalonePriceBuilder value(TypedMoney value)

      Money value of this Price.

      Parameters:
      value - value to be set
      Returns:
      Builder
    • value

      Money value of this Price.

      Parameters:
      builder - function to build the value value
      Returns:
      Builder
    • country

      public StandalonePriceBuilder country(@Nullable String country)

      Country for which this Price is valid.

      Parameters:
      country - value to be set
      Returns:
      Builder
    • customerGroup

      CustomerGroup for which this Price is valid.

      Parameters:
      builder - function to build the customerGroup value
      Returns:
      Builder
    • withCustomerGroup

      CustomerGroup for which this Price is valid.

      Parameters:
      builder - function to build the customerGroup value
      Returns:
      Builder
    • customerGroup

      public StandalonePriceBuilder customerGroup(@Nullable CustomerGroupReference customerGroup)

      CustomerGroup for which this Price is valid.

      Parameters:
      customerGroup - value to be set
      Returns:
      Builder
    • channel

      Product distribution Channel for which this Price is valid.

      Parameters:
      builder - function to build the channel value
      Returns:
      Builder
    • withChannel

      Product distribution Channel for which this Price is valid.

      Parameters:
      builder - function to build the channel value
      Returns:
      Builder
    • channel

      Product distribution Channel for which this Price is valid.

      Parameters:
      channel - value to be set
      Returns:
      Builder
    • validFrom

      public StandalonePriceBuilder validFrom(@Nullable ZonedDateTime validFrom)

      Date from which the Price is valid.

      Parameters:
      validFrom - value to be set
      Returns:
      Builder
    • validUntil

      public StandalonePriceBuilder validUntil(@Nullable ZonedDateTime validUntil)

      Date until the Price is valid. Standalone Prices that are no longer valid are not automatically deleted, but they can be deleted if necessary.

      Parameters:
      validUntil - value to be set
      Returns:
      Builder
    • tiers

      public StandalonePriceBuilder tiers(@Nullable PriceTier... tiers)

      Price tiers if any are defined.

      If discounted is present, the tiered Price is ignored for a Product Variant.

      Parameters:
      tiers - value to be set
      Returns:
      Builder
    • tiers

      Price tiers if any are defined.

      If discounted is present, the tiered Price is ignored for a Product Variant.

      Parameters:
      tiers - value to be set
      Returns:
      Builder
    • plusTiers

      public StandalonePriceBuilder plusTiers(@Nullable PriceTier... tiers)

      Price tiers if any are defined.

      If discounted is present, the tiered Price is ignored for a Product Variant.

      Parameters:
      tiers - value to be set
      Returns:
      Builder
    • plusTiers

      Price tiers if any are defined.

      If discounted is present, the tiered Price is ignored for a Product Variant.

      Parameters:
      builder - function to build the tiers value
      Returns:
      Builder
    • withTiers

      Price tiers if any are defined.

      If discounted is present, the tiered Price is ignored for a Product Variant.

      Parameters:
      builder - function to build the tiers value
      Returns:
      Builder
    • addTiers

      Price tiers if any are defined.

      If discounted is present, the tiered Price is ignored for a Product Variant.

      Parameters:
      builder - function to build the tiers value
      Returns:
      Builder
    • setTiers

      Price tiers if any are defined.

      If discounted is present, the tiered Price is ignored for a Product Variant.

      Parameters:
      builder - function to build the tiers value
      Returns:
      Builder
    • discounted

      Set if a matching ProductDiscount exists. If set, the API uses the discounted value for the Line Item price selection. When a relative discount is applied and the fraction part of the discounted price is 0.5, the discounted price is rounded in favor of the customer with the half down rounding.

      Parameters:
      builder - function to build the discounted value
      Returns:
      Builder
    • withDiscounted

      Set if a matching ProductDiscount exists. If set, the API uses the discounted value for the Line Item price selection. When a relative discount is applied and the fraction part of the discounted price is 0.5, the discounted price is rounded in favor of the customer with the half down rounding.

      Parameters:
      builder - function to build the discounted value
      Returns:
      Builder
    • discounted

      public StandalonePriceBuilder discounted(@Nullable DiscountedPrice discounted)

      Set if a matching ProductDiscount exists. If set, the API uses the discounted value for the Line Item price selection. When a relative discount is applied and the fraction part of the discounted price is 0.5, the discounted price is rounded in favor of the customer with the half down rounding.

      Parameters:
      discounted - value to be set
      Returns:
      Builder
    • custom

      Custom Fields for the StandalonePrice.

      Parameters:
      builder - function to build the custom value
      Returns:
      Builder
    • withCustom

      Custom Fields for the StandalonePrice.

      Parameters:
      builder - function to build the custom value
      Returns:
      Builder
    • custom

      Custom Fields for the StandalonePrice.

      Parameters:
      custom - value to be set
      Returns:
      Builder
    • staged

      Staged changes of the StandalonePrice. Only present if the StandalonePrice has some changes staged.

      Parameters:
      builder - function to build the staged value
      Returns:
      Builder
    • withStaged

      Staged changes of the StandalonePrice. Only present if the StandalonePrice has some changes staged.

      Parameters:
      builder - function to build the staged value
      Returns:
      Builder
    • staged

      Staged changes of the StandalonePrice. Only present if the StandalonePrice has some changes staged.

      Parameters:
      staged - value to be set
      Returns:
      Builder
    • active

      public StandalonePriceBuilder active(Boolean active)

      If set to true, the StandalonePrice is considered during Product price selection. If set to false, the StandalonePrice is not considered during Product price selection.

      Parameters:
      active - value to be set
      Returns:
      Builder
    • getId

      public String getId()

      Unique identifier of the StandalonePrice.

      Returns:
      id
    • getVersion

      public Long getVersion()

      Current version of the StandalonePrice.

      Returns:
      version
    • getCreatedAt

      public ZonedDateTime getCreatedAt()

      Date and time (UTC) the StandalonePrice was initially created.

      Returns:
      createdAt
    • getLastModifiedAt

      public ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the StandalonePrice was last updated.

      Returns:
      lastModifiedAt
    • getLastModifiedBy

      @Nullable public LastModifiedBy getLastModifiedBy()

      IDs and references that last modified the StandalonePrice.

      Returns:
      lastModifiedBy
    • getCreatedBy

      @Nullable public CreatedBy getCreatedBy()

      IDs and references that created the StandalonePrice.

      Returns:
      createdBy
    • getKey

      @Nullable public String getKey()

      User-defined unique identifier of the StandalonePrice.

      Returns:
      key
    • getSku

      public String getSku()

      SKU of the ProductVariant to which this Price is associated.

      Returns:
      sku
    • getValue

      public TypedMoney getValue()

      Money value of this Price.

      Returns:
      value
    • getCountry

      @Nullable public String getCountry()

      Country for which this Price is valid.

      Returns:
      country
    • getCustomerGroup

      @Nullable public CustomerGroupReference getCustomerGroup()

      CustomerGroup for which this Price is valid.

      Returns:
      customerGroup
    • getChannel

      @Nullable public ChannelReference getChannel()

      Product distribution Channel for which this Price is valid.

      Returns:
      channel
    • getValidFrom

      @Nullable public ZonedDateTime getValidFrom()

      Date from which the Price is valid.

      Returns:
      validFrom
    • getValidUntil

      @Nullable public ZonedDateTime getValidUntil()

      Date until the Price is valid. Standalone Prices that are no longer valid are not automatically deleted, but they can be deleted if necessary.

      Returns:
      validUntil
    • getTiers

      @Nullable public List<PriceTier> getTiers()

      Price tiers if any are defined.

      If discounted is present, the tiered Price is ignored for a Product Variant.

      Returns:
      tiers
    • getDiscounted

      @Nullable public DiscountedPrice getDiscounted()

      Set if a matching ProductDiscount exists. If set, the API uses the discounted value for the Line Item price selection. When a relative discount is applied and the fraction part of the discounted price is 0.5, the discounted price is rounded in favor of the customer with the half down rounding.

      Returns:
      discounted
    • getCustom

      @Nullable public CustomFields getCustom()

      Custom Fields for the StandalonePrice.

      Returns:
      custom
    • getStaged

      @Nullable public StagedStandalonePrice getStaged()

      Staged changes of the StandalonePrice. Only present if the StandalonePrice has some changes staged.

      Returns:
      staged
    • getActive

      public Boolean getActive()

      If set to true, the StandalonePrice is considered during Product price selection. If set to false, the StandalonePrice is not considered during Product price selection.

      Returns:
      active
    • build

      public StandalonePrice build()
      builds StandalonePrice with checking for non-null required values
      Specified by:
      build in interface Builder<StandalonePrice>
      Returns:
      StandalonePrice
    • buildUnchecked

      public StandalonePrice buildUnchecked()
      builds StandalonePrice without checking for non-null required values
      Returns:
      StandalonePrice
    • of

      public static StandalonePriceBuilder of()
      factory method for an instance of StandalonePriceBuilder
      Returns:
      builder
    • of

      public static StandalonePriceBuilder of(StandalonePrice template)
      create builder for StandalonePrice instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder