com.commercetools.history.models.change.SetCustomLineItemTaxAmountChangeBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commercetools-sdk-java-history Show documentation
Show all versions of commercetools-sdk-java-history Show documentation
The e-commerce SDK from commercetools Composable Commerce for Java
package com.commercetools.history.models.change;
import java.util.*;
import java.util.function.Function;
import io.vrap.rmf.base.client.Builder;
import io.vrap.rmf.base.client.utils.Generated;
/**
* SetCustomLineItemTaxAmountChangeBuilder
*
* Example to create an instance using the builder pattern
*
*
* SetCustomLineItemTaxAmountChange setCustomLineItemTaxAmountChange = SetCustomLineItemTaxAmountChange.builder()
* .change("{change}")
* .previousValue(previousValueBuilder -> previousValueBuilder)
* .nextValue(nextValueBuilder -> nextValueBuilder)
* .customLineItem(customLineItemBuilder -> customLineItemBuilder)
* .customLineItemId("{customLineItemId}")
* .taxMode(TaxMode.PLATFORM)
* .build()
*
*
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class SetCustomLineItemTaxAmountChangeBuilder implements Builder {
private String change;
private com.commercetools.history.models.common.TaxRate previousValue;
private com.commercetools.history.models.common.TaxRate nextValue;
private com.commercetools.history.models.common.LocalizedString customLineItem;
private String customLineItemId;
private com.commercetools.history.models.common.TaxMode taxMode;
/**
* set the value to the change
* @param change value to be set
* @return Builder
*/
public SetCustomLineItemTaxAmountChangeBuilder change(final String change) {
this.change = change;
return this;
}
/**
* Value before the change.
* @param builder function to build the previousValue value
* @return Builder
*/
public SetCustomLineItemTaxAmountChangeBuilder previousValue(
Function builder) {
this.previousValue = builder.apply(com.commercetools.history.models.common.TaxRateBuilder.of()).build();
return this;
}
/**
* Value before the change.
* @param builder function to build the previousValue value
* @return Builder
*/
public SetCustomLineItemTaxAmountChangeBuilder withPreviousValue(
Function builder) {
this.previousValue = builder.apply(com.commercetools.history.models.common.TaxRateBuilder.of());
return this;
}
/**
* Value before the change.
* @param previousValue value to be set
* @return Builder
*/
public SetCustomLineItemTaxAmountChangeBuilder previousValue(
final com.commercetools.history.models.common.TaxRate previousValue) {
this.previousValue = previousValue;
return this;
}
/**
* Value after the change.
* @param builder function to build the nextValue value
* @return Builder
*/
public SetCustomLineItemTaxAmountChangeBuilder nextValue(
Function builder) {
this.nextValue = builder.apply(com.commercetools.history.models.common.TaxRateBuilder.of()).build();
return this;
}
/**
* Value after the change.
* @param builder function to build the nextValue value
* @return Builder
*/
public SetCustomLineItemTaxAmountChangeBuilder withNextValue(
Function builder) {
this.nextValue = builder.apply(com.commercetools.history.models.common.TaxRateBuilder.of());
return this;
}
/**
* Value after the change.
* @param nextValue value to be set
* @return Builder
*/
public SetCustomLineItemTaxAmountChangeBuilder nextValue(
final com.commercetools.history.models.common.TaxRate nextValue) {
this.nextValue = nextValue;
return this;
}
/**
* Name of the updated CustomLineItem.
* @param builder function to build the customLineItem value
* @return Builder
*/
public SetCustomLineItemTaxAmountChangeBuilder customLineItem(
Function builder) {
this.customLineItem = builder.apply(com.commercetools.history.models.common.LocalizedStringBuilder.of())
.build();
return this;
}
/**
* Name of the updated CustomLineItem.
* @param builder function to build the customLineItem value
* @return Builder
*/
public SetCustomLineItemTaxAmountChangeBuilder withCustomLineItem(
Function builder) {
this.customLineItem = builder.apply(com.commercetools.history.models.common.LocalizedStringBuilder.of());
return this;
}
/**
* Name of the updated CustomLineItem.
* @param customLineItem value to be set
* @return Builder
*/
public SetCustomLineItemTaxAmountChangeBuilder customLineItem(
final com.commercetools.history.models.common.LocalizedString customLineItem) {
this.customLineItem = customLineItem;
return this;
}
/**
* id
of the updated CustomLineItem.
* @param customLineItemId value to be set
* @return Builder
*/
public SetCustomLineItemTaxAmountChangeBuilder customLineItemId(final String customLineItemId) {
this.customLineItemId = customLineItemId;
return this;
}
/**
* "ExternalAmount"
* @param taxMode value to be set
* @return Builder
*/
public SetCustomLineItemTaxAmountChangeBuilder taxMode(
final com.commercetools.history.models.common.TaxMode taxMode) {
this.taxMode = taxMode;
return this;
}
/**
* value of change}
* @return change
*/
public String getChange() {
return this.change;
}
/**
* Value before the change.
* @return previousValue
*/
public com.commercetools.history.models.common.TaxRate getPreviousValue() {
return this.previousValue;
}
/**
* Value after the change.
* @return nextValue
*/
public com.commercetools.history.models.common.TaxRate getNextValue() {
return this.nextValue;
}
/**
* Name of the updated CustomLineItem.
* @return customLineItem
*/
public com.commercetools.history.models.common.LocalizedString getCustomLineItem() {
return this.customLineItem;
}
/**
* id
of the updated CustomLineItem.
* @return customLineItemId
*/
public String getCustomLineItemId() {
return this.customLineItemId;
}
/**
* "ExternalAmount"
* @return taxMode
*/
public com.commercetools.history.models.common.TaxMode getTaxMode() {
return this.taxMode;
}
/**
* builds SetCustomLineItemTaxAmountChange with checking for non-null required values
* @return SetCustomLineItemTaxAmountChange
*/
public SetCustomLineItemTaxAmountChange build() {
Objects.requireNonNull(change, SetCustomLineItemTaxAmountChange.class + ": change is missing");
Objects.requireNonNull(previousValue, SetCustomLineItemTaxAmountChange.class + ": previousValue is missing");
Objects.requireNonNull(nextValue, SetCustomLineItemTaxAmountChange.class + ": nextValue is missing");
Objects.requireNonNull(customLineItem, SetCustomLineItemTaxAmountChange.class + ": customLineItem is missing");
Objects.requireNonNull(customLineItemId,
SetCustomLineItemTaxAmountChange.class + ": customLineItemId is missing");
Objects.requireNonNull(taxMode, SetCustomLineItemTaxAmountChange.class + ": taxMode is missing");
return new SetCustomLineItemTaxAmountChangeImpl(change, previousValue, nextValue, customLineItem,
customLineItemId, taxMode);
}
/**
* builds SetCustomLineItemTaxAmountChange without checking for non-null required values
* @return SetCustomLineItemTaxAmountChange
*/
public SetCustomLineItemTaxAmountChange buildUnchecked() {
return new SetCustomLineItemTaxAmountChangeImpl(change, previousValue, nextValue, customLineItem,
customLineItemId, taxMode);
}
/**
* factory method for an instance of SetCustomLineItemTaxAmountChangeBuilder
* @return builder
*/
public static SetCustomLineItemTaxAmountChangeBuilder of() {
return new SetCustomLineItemTaxAmountChangeBuilder();
}
/**
* create builder for SetCustomLineItemTaxAmountChange instance
* @param template instance with prefilled values for the builder
* @return builder
*/
public static SetCustomLineItemTaxAmountChangeBuilder of(final SetCustomLineItemTaxAmountChange template) {
SetCustomLineItemTaxAmountChangeBuilder builder = new SetCustomLineItemTaxAmountChangeBuilder();
builder.change = template.getChange();
builder.previousValue = template.getPreviousValue();
builder.nextValue = template.getNextValue();
builder.customLineItem = template.getCustomLineItem();
builder.customLineItemId = template.getCustomLineItemId();
builder.taxMode = template.getTaxMode();
return builder;
}
}