Class StandalonePriceImportBuilder

java.lang.Object
com.commercetools.importapi.models.standalone_prices.StandalonePriceImportBuilder
All Implemented Interfaces:
Builder<StandalonePriceImport>

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

     StandalonePriceImport standalonePriceImport = StandalonePriceImport.builder()
             .key("{key}")
             .sku("{sku}")
             .value(valueBuilder -> valueBuilder)
             .build()
 
  • Constructor Details

    • StandalonePriceImportBuilder

      public StandalonePriceImportBuilder()
  • Method Details

    • key

      User-defined unique identifier for the Standalone Price. If a StandalonePrice) with this key exists, it will be updated with the imported data.

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

      Identifies the ProductVariant to which this Standalone Price is associated. This value is not validated to exist in Product Variants.

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

      Sets the money value of this Price.

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

      Sets the money value of this Price.

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

      public StandalonePriceImportBuilder country(@Nullable String country)

      Sets the country for this Price, if the Price does not yet have a country.

      The country cannot be updated. Attempting to update the an existing country will result in an InvalidFieldsUpdate error.

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

      Sets the CustomerGroup for this Price, if the Price does not yet have a CustomerGroup.

      The CustomerGroup cannot be updated. Attempting to update an existing CustomerGroup will result in an InvalidFieldsUpdate error.

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

      Sets the CustomerGroup for this Price, if the Price does not yet have a CustomerGroup.

      The CustomerGroup cannot be updated. Attempting to update an existing CustomerGroup will result in an InvalidFieldsUpdate error.

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

      public StandalonePriceImportBuilder customerGroup(@Nullable CustomerGroupKeyReference customerGroup)

      Sets the CustomerGroup for this Price, if the Price does not yet have a CustomerGroup.

      The CustomerGroup cannot be updated. Attempting to update an existing CustomerGroup will result in an InvalidFieldsUpdate error.

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

      Sets the product distribution Channel for this Price, if the Price does not yet have a Channel.

      The Channel cannot be updated. Attempting to update an existing Channel will result in an InvalidFieldsUpdate error.

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

      Sets the product distribution Channel for this Price, if the Price does not yet have a Channel.

      The Channel cannot be updated. Attempting to update an existing Channel will result in an InvalidFieldsUpdate error.

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

      public StandalonePriceImportBuilder channel(@Nullable ChannelKeyReference channel)

      Sets the product distribution Channel for this Price, if the Price does not yet have a Channel.

      The Channel cannot be updated. Attempting to update an existing Channel will result in an InvalidFieldsUpdate error.

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

      public StandalonePriceImportBuilder validFrom(@Nullable ZonedDateTime validFrom)

      Sets the date from which the Price is valid.

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

      public StandalonePriceImportBuilder validUntil(@Nullable ZonedDateTime validUntil)

      Sets the date until the Price is valid.

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

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

      Sets price tiers.

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

      public StandalonePriceImportBuilder tiers(@Nullable List<PriceTier> tiers)

      Sets price tiers.

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

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

      Sets price tiers.

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

      Sets price tiers.

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

      Sets price tiers.

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

      Sets price tiers.

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

      Sets price tiers.

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

      Sets a discounted price for this Price that is different from the base price with value.

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

      Sets a discounted price for this Price that is different from the base price with value.

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

      public StandalonePriceImportBuilder discounted(@Nullable DiscountedPrice discounted)

      Sets a discounted price for this Price that is different from the base price with value.

      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

      public StandalonePriceImportBuilder custom(@Nullable Custom custom)

      Custom Fields for the StandalonePrice.

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

      public String getKey()

      User-defined unique identifier for the Standalone Price. If a StandalonePrice) with this key exists, it will be updated with the imported data.

      Returns:
      key
    • getSku

      public String getSku()

      Identifies the ProductVariant to which this Standalone Price is associated. This value is not validated to exist in Product Variants.

      Returns:
      sku
    • getValue

      public TypedMoney getValue()

      Sets the money value of this Price.

      Returns:
      value
    • getCountry

      @Nullable public String getCountry()

      Sets the country for this Price, if the Price does not yet have a country.

      The country cannot be updated. Attempting to update the an existing country will result in an InvalidFieldsUpdate error.

      Returns:
      country
    • getCustomerGroup

      @Nullable public CustomerGroupKeyReference getCustomerGroup()

      Sets the CustomerGroup for this Price, if the Price does not yet have a CustomerGroup.

      The CustomerGroup cannot be updated. Attempting to update an existing CustomerGroup will result in an InvalidFieldsUpdate error.

      Returns:
      customerGroup
    • getChannel

      @Nullable public ChannelKeyReference getChannel()

      Sets the product distribution Channel for this Price, if the Price does not yet have a Channel.

      The Channel cannot be updated. Attempting to update an existing Channel will result in an InvalidFieldsUpdate error.

      Returns:
      channel
    • getValidFrom

      @Nullable public ZonedDateTime getValidFrom()

      Sets the date from which the Price is valid.

      Returns:
      validFrom
    • getValidUntil

      @Nullable public ZonedDateTime getValidUntil()

      Sets the date until the Price is valid.

      Returns:
      validUntil
    • getTiers

      @Nullable public List<PriceTier> getTiers()

      Sets price tiers.

      Returns:
      tiers
    • getDiscounted

      @Nullable public DiscountedPrice getDiscounted()

      Sets a discounted price for this Price that is different from the base price with value.

      Returns:
      discounted
    • getCustom

      @Nullable public Custom getCustom()

      Custom Fields for the StandalonePrice.

      Returns:
      custom
    • build

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

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

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

      create builder for StandalonePriceImport instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder