Class QueryPriceBuilder

java.lang.Object
com.commercetools.api.models.common.QueryPriceBuilder
All Implemented Interfaces:
Builder<QueryPrice>

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

     QueryPrice queryPrice = QueryPrice.builder()
             .value(valueBuilder -> valueBuilder)
             .build()
 
  • Constructor Details

    • QueryPriceBuilder

      public QueryPriceBuilder()
  • Method Details

    • id

      Unique identifier of the given Price.

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

      Money value of the given Price.

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

      public QueryPriceBuilder withValue(Function<MoneyBuilder,Money> builder)

      Money value of the given Price.

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

      public QueryPriceBuilder value(Money value)

      Money value of the given Price.

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

      public QueryPriceBuilder country(@Nullable String country)

      Country for which the given Price is valid.

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

      CustomerGroup for which the given Price is valid.

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

      CustomerGroup for which the given Price is valid.

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

      public QueryPriceBuilder customerGroup(@Nullable CustomerGroupReference customerGroup)

      CustomerGroup for which the given Price is valid.

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

      ProductDistribution Channel for which the given Price is valid.

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

      ProductDistribution Channel for which the given Price is valid.

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

      public QueryPriceBuilder channel(@Nullable ChannelReference channel)

      ProductDistribution Channel for which the given Price is valid.

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

      public QueryPriceBuilder validFrom(@Nullable ZonedDateTime validFrom)

      Date from which the given Price is valid.

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

      public QueryPriceBuilder validUntil(@Nullable ZonedDateTime validUntil)

      Date until which the given Price is valid.

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

      DiscountedPrice you specify for the given Price.

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

      DiscountedPrice you specify for the given Price.

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

      public QueryPriceBuilder discounted(@Nullable DiscountedPriceDraft discounted)

      DiscountedPrice you specify for the given Price.

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

      Custom Fields for the Price.

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

      Custom Fields for the Price.

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

      public QueryPriceBuilder custom(@Nullable CustomFields custom)

      Custom Fields for the Price.

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

      public QueryPriceBuilder tiers(@Nullable PriceTierDraft... tiers)

      Price tier applied when the minimum quantity for the LineItem of a ProductVariant with the related Price is reached in a Cart.

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

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

      Price tier applied when the minimum quantity for the LineItem of a ProductVariant with the related Price is reached in a Cart.

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

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

      public QueryPriceBuilder plusTiers(@Nullable PriceTierDraft... tiers)

      Price tier applied when the minimum quantity for the LineItem of a ProductVariant with the related Price is reached in a Cart.

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

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

      Price tier applied when the minimum quantity for the LineItem of a ProductVariant with the related Price is reached in a Cart.

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

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

      Price tier applied when the minimum quantity for the LineItem of a ProductVariant with the related Price is reached in a Cart.

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

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

      Price tier applied when the minimum quantity for the LineItem of a ProductVariant with the related Price is reached in a Cart.

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

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

      Price tier applied when the minimum quantity for the LineItem of a ProductVariant with the related Price is reached in a Cart.

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

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

      @Nullable public String getId()

      Unique identifier of the given Price.

      Returns:
      id
    • getValue

      public Money getValue()

      Money value of the given Price.

      Returns:
      value
    • getCountry

      @Nullable public String getCountry()

      Country for which the given Price is valid.

      Returns:
      country
    • getCustomerGroup

      @Nullable public CustomerGroupReference getCustomerGroup()

      CustomerGroup for which the given Price is valid.

      Returns:
      customerGroup
    • getChannel

      @Nullable public ChannelReference getChannel()

      ProductDistribution Channel for which the given Price is valid.

      Returns:
      channel
    • getValidFrom

      @Nullable public ZonedDateTime getValidFrom()

      Date from which the given Price is valid.

      Returns:
      validFrom
    • getValidUntil

      @Nullable public ZonedDateTime getValidUntil()

      Date until which the given Price is valid.

      Returns:
      validUntil
    • getDiscounted

      @Nullable public DiscountedPriceDraft getDiscounted()

      DiscountedPrice you specify for the given Price.

      Returns:
      discounted
    • getCustom

      @Nullable public CustomFields getCustom()

      Custom Fields for the Price.

      Returns:
      custom
    • getTiers

      @Nullable public List<PriceTierDraft> getTiers()

      Price tier applied when the minimum quantity for the LineItem of a ProductVariant with the related Price is reached in a Cart.

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

      Returns:
      tiers
    • build

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

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

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

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