Class PriceImportBuilder

java.lang.Object
com.commercetools.importapi.models.prices.PriceImportBuilder
All Implemented Interfaces:
Builder<PriceImport>

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

     PriceImport priceImport = PriceImport.builder()
             .key("{key}")
             .value(valueBuilder -> valueBuilder)
             .productVariant(productVariantBuilder -> productVariantBuilder)
             .product(productBuilder -> productBuilder)
             .build()
 
  • Constructor Details

    • PriceImportBuilder

      public PriceImportBuilder()
  • Method Details

    • key

      public PriceImportBuilder key(String key)

      User-defined unique identifier for the Embedded Price. If a Price with this key exists on the specified productVariant, it will be updated with the imported data.

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

      public PriceImportBuilder value(TypedMoney value)

      Maps to Price.value.

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

      public PriceImportBuilder value(Function<TypedMoneyBuilder,Builder<? extends TypedMoney>> builder)

      Maps to Price.value.

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

      public PriceImportBuilder country(@Nullable String country)

      Maps to Price.county.

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

      public PriceImportBuilder validFrom(@Nullable ZonedDateTime validFrom)

      Maps to Price.validFrom.

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

      public PriceImportBuilder validUntil(@Nullable ZonedDateTime validUntil)

      Maps to Price.validUntil.

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

      The Reference to the CustomerGroup with which the Price is associated. If referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the necessary CustomerGroup is created.

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

      The Reference to the CustomerGroup with which the Price is associated. If referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the necessary CustomerGroup is created.

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

      public PriceImportBuilder customerGroup(@Nullable CustomerGroupKeyReference customerGroup)

      The Reference to the CustomerGroup with which the Price is associated. If referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the necessary CustomerGroup is created.

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

      The Reference to the Channel with which the Price is associated. If referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the necessary Channel is created.

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

      The Reference to the Channel with which the Price is associated. If referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the necessary Channel is created.

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

      The Reference to the Channel with which the Price is associated. If referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the necessary Channel is created.

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

      Sets a discounted price from an external service.

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

      Sets a discounted price from an external service.

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

      public PriceImportBuilder discounted(@Nullable DiscountedPrice discounted)

      Sets a discounted price from an external service.

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

      public PriceImportBuilder staged(@Nullable Boolean staged)
      • Set to false to update both the current and staged projections of the Product with the new Price data.
      • Leave empty or set to true to only update the staged projection.
      Parameters:
      staged - value to be set
      Returns:
      Builder
    • tiers

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

      The tiered prices for this price.

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

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

      The tiered prices for this price.

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

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

      The tiered prices for this price.

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

      The tiered prices for this price.

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

      The tiered prices for this price.

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

      The tiered prices for this price.

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

      The tiered prices for this price.

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

      The custom fields for this price.

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

      public PriceImportBuilder withCustom(Function<CustomBuilder,Custom> builder)

      The custom fields for this price.

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

      public PriceImportBuilder custom(@Nullable Custom custom)

      The custom fields for this price.

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

      The ProductVariant in which this Embedded Price is contained. The Reference to the ProductVariant with which the Price is associated. If the referenced ProductVariant does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductVariant is created.

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

      The ProductVariant in which this Embedded Price is contained. The Reference to the ProductVariant with which the Price is associated. If the referenced ProductVariant does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductVariant is created.

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

      public PriceImportBuilder productVariant(ProductVariantKeyReference productVariant)

      The ProductVariant in which this Embedded Price is contained. The Reference to the ProductVariant with which the Price is associated. If the referenced ProductVariant does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductVariant is created.

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

      The Product in which the Product Variant containing this Embedded Price is contained. Maps to ProductVariant.product. The Reference to the Product with which the Price is associated. If referenced Product does not exist, the state of the ImportOperation will be set to unresolved until the necessary Product is created.

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

      The Product in which the Product Variant containing this Embedded Price is contained. Maps to ProductVariant.product. The Reference to the Product with which the Price is associated. If referenced Product does not exist, the state of the ImportOperation will be set to unresolved until the necessary Product is created.

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

      public PriceImportBuilder product(ProductKeyReference product)

      The Product in which the Product Variant containing this Embedded Price is contained. Maps to ProductVariant.product. The Reference to the Product with which the Price is associated. If referenced Product does not exist, the state of the ImportOperation will be set to unresolved until the necessary Product is created.

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

      public String getKey()

      User-defined unique identifier for the Embedded Price. If a Price with this key exists on the specified productVariant, it will be updated with the imported data.

      Returns:
      key
    • getValue

      public TypedMoney getValue()

      Maps to Price.value.

      Returns:
      value
    • getCountry

      @Nullable public String getCountry()

      Maps to Price.county.

      Returns:
      country
    • getValidFrom

      @Nullable public ZonedDateTime getValidFrom()

      Maps to Price.validFrom.

      Returns:
      validFrom
    • getValidUntil

      @Nullable public ZonedDateTime getValidUntil()

      Maps to Price.validUntil.

      Returns:
      validUntil
    • getCustomerGroup

      @Nullable public CustomerGroupKeyReference getCustomerGroup()

      The Reference to the CustomerGroup with which the Price is associated. If referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the necessary CustomerGroup is created.

      Returns:
      customerGroup
    • getChannel

      @Nullable public ChannelKeyReference getChannel()

      The Reference to the Channel with which the Price is associated. If referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the necessary Channel is created.

      Returns:
      channel
    • getDiscounted

      @Nullable public DiscountedPrice getDiscounted()

      Sets a discounted price from an external service.

      Returns:
      discounted
    • getStaged

      @Nullable public Boolean getStaged()
      • Set to false to update both the current and staged projections of the Product with the new Price data.
      • Leave empty or set to true to only update the staged projection.
      Returns:
      staged
    • getTiers

      @Nullable public List<PriceTier> getTiers()

      The tiered prices for this price.

      Returns:
      tiers
    • getCustom

      @Nullable public Custom getCustom()

      The custom fields for this price.

      Returns:
      custom
    • getProductVariant

      public ProductVariantKeyReference getProductVariant()

      The ProductVariant in which this Embedded Price is contained. The Reference to the ProductVariant with which the Price is associated. If the referenced ProductVariant does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductVariant is created.

      Returns:
      productVariant
    • getProduct

      public ProductKeyReference getProduct()

      The Product in which the Product Variant containing this Embedded Price is contained. Maps to ProductVariant.product. The Reference to the Product with which the Price is associated. If referenced Product does not exist, the state of the ImportOperation will be set to unresolved until the necessary Product is created.

      Returns:
      product
    • build

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

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

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

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