All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.commercetools.history.models.change_value.ChangeTargetMultiBuyCustomLineItemsChangeValueBuilder Maven / Gradle / Ivy

There is a newer version: 17.15.1
Show newest version

package com.commercetools.history.models.change_value;

import java.util.*;

import io.vrap.rmf.base.client.Builder;
import io.vrap.rmf.base.client.utils.Generated;

/**
 * ChangeTargetMultiBuyCustomLineItemsChangeValueBuilder
 * 
* Example to create an instance using the builder pattern *
*

 *     ChangeTargetMultiBuyCustomLineItemsChangeValue changeTargetMultiBuyCustomLineItemsChangeValue = ChangeTargetMultiBuyCustomLineItemsChangeValue.builder()
 *             .predicate("{predicate}")
 *             .triggerQuantity(1)
 *             .discountedQuantity(1)
 *             .maxOccurrence(1)
 *             .selectionMode(SelectionMode.CHEAPEST)
 *             .build()
 * 
*
*/ @Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") public class ChangeTargetMultiBuyCustomLineItemsChangeValueBuilder implements Builder { private String predicate; private Integer triggerQuantity; private Integer discountedQuantity; private Integer maxOccurrence; private com.commercetools.history.models.common.SelectionMode selectionMode; /** *

Valid CustomLineItem target predicate.

* @param predicate value to be set * @return Builder */ public ChangeTargetMultiBuyCustomLineItemsChangeValueBuilder predicate(final String predicate) { this.predicate = predicate; return this; } /** *

Quantity of Custom Line Items that triggered the application of the discount.

* @param triggerQuantity value to be set * @return Builder */ public ChangeTargetMultiBuyCustomLineItemsChangeValueBuilder triggerQuantity(final Integer triggerQuantity) { this.triggerQuantity = triggerQuantity; return this; } /** *

Quantity of Custom Line Items discounted per application of this discount.

* @param discountedQuantity value to be set * @return Builder */ public ChangeTargetMultiBuyCustomLineItemsChangeValueBuilder discountedQuantity(final Integer discountedQuantity) { this.discountedQuantity = discountedQuantity; return this; } /** *

Maximum number of times the discount is applicable.

* @param maxOccurrence value to be set * @return Builder */ public ChangeTargetMultiBuyCustomLineItemsChangeValueBuilder maxOccurrence(final Integer maxOccurrence) { this.maxOccurrence = maxOccurrence; return this; } /** *

SelectionMode based on which particular Custom Line Items were discounted.

* @param selectionMode value to be set * @return Builder */ public ChangeTargetMultiBuyCustomLineItemsChangeValueBuilder selectionMode( final com.commercetools.history.models.common.SelectionMode selectionMode) { this.selectionMode = selectionMode; return this; } /** *

Valid CustomLineItem target predicate.

* @return predicate */ public String getPredicate() { return this.predicate; } /** *

Quantity of Custom Line Items that triggered the application of the discount.

* @return triggerQuantity */ public Integer getTriggerQuantity() { return this.triggerQuantity; } /** *

Quantity of Custom Line Items discounted per application of this discount.

* @return discountedQuantity */ public Integer getDiscountedQuantity() { return this.discountedQuantity; } /** *

Maximum number of times the discount is applicable.

* @return maxOccurrence */ public Integer getMaxOccurrence() { return this.maxOccurrence; } /** *

SelectionMode based on which particular Custom Line Items were discounted.

* @return selectionMode */ public com.commercetools.history.models.common.SelectionMode getSelectionMode() { return this.selectionMode; } /** * builds ChangeTargetMultiBuyCustomLineItemsChangeValue with checking for non-null required values * @return ChangeTargetMultiBuyCustomLineItemsChangeValue */ public ChangeTargetMultiBuyCustomLineItemsChangeValue build() { Objects.requireNonNull(predicate, ChangeTargetMultiBuyCustomLineItemsChangeValue.class + ": predicate is missing"); Objects.requireNonNull(triggerQuantity, ChangeTargetMultiBuyCustomLineItemsChangeValue.class + ": triggerQuantity is missing"); Objects.requireNonNull(discountedQuantity, ChangeTargetMultiBuyCustomLineItemsChangeValue.class + ": discountedQuantity is missing"); Objects.requireNonNull(maxOccurrence, ChangeTargetMultiBuyCustomLineItemsChangeValue.class + ": maxOccurrence is missing"); Objects.requireNonNull(selectionMode, ChangeTargetMultiBuyCustomLineItemsChangeValue.class + ": selectionMode is missing"); return new ChangeTargetMultiBuyCustomLineItemsChangeValueImpl(predicate, triggerQuantity, discountedQuantity, maxOccurrence, selectionMode); } /** * builds ChangeTargetMultiBuyCustomLineItemsChangeValue without checking for non-null required values * @return ChangeTargetMultiBuyCustomLineItemsChangeValue */ public ChangeTargetMultiBuyCustomLineItemsChangeValue buildUnchecked() { return new ChangeTargetMultiBuyCustomLineItemsChangeValueImpl(predicate, triggerQuantity, discountedQuantity, maxOccurrence, selectionMode); } /** * factory method for an instance of ChangeTargetMultiBuyCustomLineItemsChangeValueBuilder * @return builder */ public static ChangeTargetMultiBuyCustomLineItemsChangeValueBuilder of() { return new ChangeTargetMultiBuyCustomLineItemsChangeValueBuilder(); } /** * create builder for ChangeTargetMultiBuyCustomLineItemsChangeValue instance * @param template instance with prefilled values for the builder * @return builder */ public static ChangeTargetMultiBuyCustomLineItemsChangeValueBuilder of( final ChangeTargetMultiBuyCustomLineItemsChangeValue template) { ChangeTargetMultiBuyCustomLineItemsChangeValueBuilder builder = new ChangeTargetMultiBuyCustomLineItemsChangeValueBuilder(); builder.predicate = template.getPredicate(); builder.triggerQuantity = template.getTriggerQuantity(); builder.discountedQuantity = template.getDiscountedQuantity(); builder.maxOccurrence = template.getMaxOccurrence(); builder.selectionMode = template.getSelectionMode(); return builder; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy