Class PriceDraftImportBuilder

java.lang.Object
com.commercetools.importapi.models.productdrafts.PriceDraftImportBuilder
All Implemented Interfaces:
Builder<PriceDraftImport>

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

     PriceDraftImport priceDraftImport = PriceDraftImport.builder()
             .value(valueBuilder -> valueBuilder)
             .key("{key}")
             .build()
 
  • Constructor Details

    • PriceDraftImportBuilder

      public PriceDraftImportBuilder()
  • Method Details

    • value

      public PriceDraftImportBuilder 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 PriceDraftImportBuilder country(@Nullable String country)

      Set this field if this Price is only valid for the specified country.

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

      Set this field if this Price is only valid for the referenced CustomerGroup. If the referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the referenced CustomerGroup is created.

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

      Set this field if this Price is only valid for the referenced CustomerGroup. If the referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the referenced CustomerGroup is created.

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

      public PriceDraftImportBuilder customerGroup(@Nullable CustomerGroupKeyReference customerGroup)

      Set this field if this Price is only valid for the referenced CustomerGroup. If the referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the referenced CustomerGroup is created.

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

      Set this field if this Price is only valid for the referenced ProductDistribution Channel. If the referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the referenced Channel is created.

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

      Set this field if this Price is only valid for the referenced ProductDistribution Channel. If the referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the referenced Channel is created.

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

      public PriceDraftImportBuilder channel(@Nullable ChannelKeyReference channel)

      Set this field if this Price is only valid for the referenced ProductDistribution Channel. If the referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the referenced Channel is created.

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

      public PriceDraftImportBuilder validFrom(@Nullable ZonedDateTime validFrom)

      Set this field if this Price is only valid from the specified date and time. Must be at least 1 ms earlier than validUntil.

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

      public PriceDraftImportBuilder validUntil(@Nullable ZonedDateTime validUntil)

      Set this field if this Price is only valid until the specified date and time. Must be at least 1 ms later than validFrom.

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

      Custom Fields for the Embedded Price.

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

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

      Custom Fields for the Embedded Price.

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

      public PriceDraftImportBuilder custom(@Nullable Custom custom)

      Custom Fields for the Embedded Price.

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

      Set this field to add a DiscountedPrice from an external service.

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

      Set this field to add a DiscountedPrice from an external service.

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

      public PriceDraftImportBuilder discounted(@Nullable DiscountedPrice discounted)

      Set this field to add a DiscountedPrice from an external service.

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

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

      The tiered prices for this price.

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

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

      The tiered prices for this price.

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

      public PriceDraftImportBuilder 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
    • key

      public PriceDraftImportBuilder key(String key)

      User-defined unique identifier for the Embedded Price.

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

      public TypedMoney getValue()

      Money value of this Price.

      Returns:
      value
    • getCountry

      @Nullable public String getCountry()

      Set this field if this Price is only valid for the specified country.

      Returns:
      country
    • getCustomerGroup

      @Nullable public CustomerGroupKeyReference getCustomerGroup()

      Set this field if this Price is only valid for the referenced CustomerGroup. If the referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the referenced CustomerGroup is created.

      Returns:
      customerGroup
    • getChannel

      @Nullable public ChannelKeyReference getChannel()

      Set this field if this Price is only valid for the referenced ProductDistribution Channel. If the referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the referenced Channel is created.

      Returns:
      channel
    • getValidFrom

      @Nullable public ZonedDateTime getValidFrom()

      Set this field if this Price is only valid from the specified date and time. Must be at least 1 ms earlier than validUntil.

      Returns:
      validFrom
    • getValidUntil

      @Nullable public ZonedDateTime getValidUntil()

      Set this field if this Price is only valid until the specified date and time. Must be at least 1 ms later than validFrom.

      Returns:
      validUntil
    • getCustom

      @Nullable public Custom getCustom()

      Custom Fields for the Embedded Price.

      Returns:
      custom
    • getDiscounted

      @Nullable public DiscountedPrice getDiscounted()

      Set this field to add a DiscountedPrice from an external service.

      Returns:
      discounted
    • getTiers

      @Nullable public List<PriceTier> getTiers()

      The tiered prices for this price.

      Returns:
      tiers
    • getKey

      public String getKey()

      User-defined unique identifier for the Embedded Price.

      Returns:
      key
    • build

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

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

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

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