Class ProductDiscountValueAbsoluteDraftBuilder
- All Implemented Interfaces:
Builder<ProductDiscountValueAbsoluteDraft>
Example to create an instance using the builder pattern
ProductDiscountValueAbsoluteDraft productDiscountValueAbsoluteDraft = ProductDiscountValueAbsoluteDraft.builder()
.plusMoney(moneyBuilder -> moneyBuilder)
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddMoney(Function<MoneyBuilder, Money> builder) Money values in different currencies.build()builds ProductDiscountValueAbsoluteDraft with checking for non-null required valuesbuilds ProductDiscountValueAbsoluteDraft without checking for non-null required valuesgetMoney()Money values in different currencies.Money values in different currencies.Money values in different currencies.of()factory method for an instance of ProductDiscountValueAbsoluteDraftBuilderof(ProductDiscountValueAbsoluteDraft template) create builder for ProductDiscountValueAbsoluteDraft instanceMoney values in different currencies.plusMoney(Function<MoneyBuilder, MoneyBuilder> builder) Money values in different currencies.setMoney(Function<MoneyBuilder, Money> builder) Money values in different currencies.withMoney(Function<MoneyBuilder, MoneyBuilder> builder) Money values in different currencies.
-
Constructor Details
-
ProductDiscountValueAbsoluteDraftBuilder
public ProductDiscountValueAbsoluteDraftBuilder()
-
-
Method Details
-
money
Money values in different currencies. An absolute Product Discount will match a price only if the array contains a value with the same currency. For example, if it contains 10€ and 15$, the matching € price will be decreased by 10€ and the matching $ price will be decreased by 15$.
If the value exceeds the price of a Product Variant, the discounted price (of the Product Variant) will be a negative value.
If the array is empty or has multiple values of the same currency, the API returns an InvalidOperation error.
- Parameters:
money- value to be set- Returns:
- Builder
-
money
Money values in different currencies. An absolute Product Discount will match a price only if the array contains a value with the same currency. For example, if it contains 10€ and 15$, the matching € price will be decreased by 10€ and the matching $ price will be decreased by 15$.
If the value exceeds the price of a Product Variant, the discounted price (of the Product Variant) will be a negative value.
If the array is empty or has multiple values of the same currency, the API returns an InvalidOperation error.
- Parameters:
money- value to be set- Returns:
- Builder
-
plusMoney
Money values in different currencies. An absolute Product Discount will match a price only if the array contains a value with the same currency. For example, if it contains 10€ and 15$, the matching € price will be decreased by 10€ and the matching $ price will be decreased by 15$.
If the value exceeds the price of a Product Variant, the discounted price (of the Product Variant) will be a negative value.
If the array is empty or has multiple values of the same currency, the API returns an InvalidOperation error.
- Parameters:
money- value to be set- Returns:
- Builder
-
plusMoney
public ProductDiscountValueAbsoluteDraftBuilder plusMoney(Function<MoneyBuilder, MoneyBuilder> builder) Money values in different currencies. An absolute Product Discount will match a price only if the array contains a value with the same currency. For example, if it contains 10€ and 15$, the matching € price will be decreased by 10€ and the matching $ price will be decreased by 15$.
If the value exceeds the price of a Product Variant, the discounted price (of the Product Variant) will be a negative value.
If the array is empty or has multiple values of the same currency, the API returns an InvalidOperation error.
- Parameters:
builder- function to build the money value- Returns:
- Builder
-
withMoney
public ProductDiscountValueAbsoluteDraftBuilder withMoney(Function<MoneyBuilder, MoneyBuilder> builder) Money values in different currencies. An absolute Product Discount will match a price only if the array contains a value with the same currency. For example, if it contains 10€ and 15$, the matching € price will be decreased by 10€ and the matching $ price will be decreased by 15$.
If the value exceeds the price of a Product Variant, the discounted price (of the Product Variant) will be a negative value.
If the array is empty or has multiple values of the same currency, the API returns an InvalidOperation error.
- Parameters:
builder- function to build the money value- Returns:
- Builder
-
addMoney
Money values in different currencies. An absolute Product Discount will match a price only if the array contains a value with the same currency. For example, if it contains 10€ and 15$, the matching € price will be decreased by 10€ and the matching $ price will be decreased by 15$.
If the value exceeds the price of a Product Variant, the discounted price (of the Product Variant) will be a negative value.
If the array is empty or has multiple values of the same currency, the API returns an InvalidOperation error.
- Parameters:
builder- function to build the money value- Returns:
- Builder
-
setMoney
Money values in different currencies. An absolute Product Discount will match a price only if the array contains a value with the same currency. For example, if it contains 10€ and 15$, the matching € price will be decreased by 10€ and the matching $ price will be decreased by 15$.
If the value exceeds the price of a Product Variant, the discounted price (of the Product Variant) will be a negative value.
If the array is empty or has multiple values of the same currency, the API returns an InvalidOperation error.
- Parameters:
builder- function to build the money value- Returns:
- Builder
-
getMoney
Money values in different currencies. An absolute Product Discount will match a price only if the array contains a value with the same currency. For example, if it contains 10€ and 15$, the matching € price will be decreased by 10€ and the matching $ price will be decreased by 15$.
If the value exceeds the price of a Product Variant, the discounted price (of the Product Variant) will be a negative value.
If the array is empty or has multiple values of the same currency, the API returns an InvalidOperation error.
- Returns:
- money
-
build
builds ProductDiscountValueAbsoluteDraft with checking for non-null required values- Specified by:
buildin interfaceBuilder<ProductDiscountValueAbsoluteDraft>- Returns:
- ProductDiscountValueAbsoluteDraft
-
buildUnchecked
builds ProductDiscountValueAbsoluteDraft without checking for non-null required values- Returns:
- ProductDiscountValueAbsoluteDraft
-
of
factory method for an instance of ProductDiscountValueAbsoluteDraftBuilder- Returns:
- builder
-
of
public static ProductDiscountValueAbsoluteDraftBuilder of(ProductDiscountValueAbsoluteDraft template) create builder for ProductDiscountValueAbsoluteDraft instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-