com.commercetools.history.models.change.RemoveBillingAddressIdChangeBuilder 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;
/**
* RemoveBillingAddressIdChangeBuilder
*
* Example to create an instance using the builder pattern
*
*
* RemoveBillingAddressIdChange removeBillingAddressIdChange = RemoveBillingAddressIdChange.builder()
* .change("{change}")
* .plusPreviousValue(previousValueBuilder -> previousValueBuilder)
* .plusNextValue(nextValueBuilder -> nextValueBuilder)
* .address(addressBuilder -> addressBuilder)
* .build()
*
*
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class RemoveBillingAddressIdChangeBuilder implements Builder {
private String change;
private java.util.List previousValue;
private java.util.List nextValue;
private com.commercetools.history.models.common.Address address;
/**
* set the value to the change
* @param change value to be set
* @return Builder
*/
public RemoveBillingAddressIdChangeBuilder change(final String change) {
this.change = change;
return this;
}
/**
* Value before the change.
* @param previousValue value to be set
* @return Builder
*/
public RemoveBillingAddressIdChangeBuilder previousValue(final String... previousValue) {
this.previousValue = new ArrayList<>(Arrays.asList(previousValue));
return this;
}
/**
* Value before the change.
* @param previousValue value to be set
* @return Builder
*/
public RemoveBillingAddressIdChangeBuilder previousValue(final java.util.List previousValue) {
this.previousValue = previousValue;
return this;
}
/**
* Value before the change.
* @param previousValue value to be set
* @return Builder
*/
public RemoveBillingAddressIdChangeBuilder plusPreviousValue(final String... previousValue) {
if (this.previousValue == null) {
this.previousValue = new ArrayList<>();
}
this.previousValue.addAll(Arrays.asList(previousValue));
return this;
}
/**
* Value after the change.
* @param nextValue value to be set
* @return Builder
*/
public RemoveBillingAddressIdChangeBuilder nextValue(final String... nextValue) {
this.nextValue = new ArrayList<>(Arrays.asList(nextValue));
return this;
}
/**
* Value after the change.
* @param nextValue value to be set
* @return Builder
*/
public RemoveBillingAddressIdChangeBuilder nextValue(final java.util.List nextValue) {
this.nextValue = nextValue;
return this;
}
/**
* Value after the change.
* @param nextValue value to be set
* @return Builder
*/
public RemoveBillingAddressIdChangeBuilder plusNextValue(final String... nextValue) {
if (this.nextValue == null) {
this.nextValue = new ArrayList<>();
}
this.nextValue.addAll(Arrays.asList(nextValue));
return this;
}
/**
* Address removed from billingAddressesIds
.
* @param builder function to build the address value
* @return Builder
*/
public RemoveBillingAddressIdChangeBuilder address(
Function builder) {
this.address = builder.apply(com.commercetools.history.models.common.AddressBuilder.of()).build();
return this;
}
/**
* Address removed from billingAddressesIds
.
* @param builder function to build the address value
* @return Builder
*/
public RemoveBillingAddressIdChangeBuilder withAddress(
Function builder) {
this.address = builder.apply(com.commercetools.history.models.common.AddressBuilder.of());
return this;
}
/**
* Address removed from billingAddressesIds
.
* @param address value to be set
* @return Builder
*/
public RemoveBillingAddressIdChangeBuilder address(final com.commercetools.history.models.common.Address address) {
this.address = address;
return this;
}
/**
* value of change}
* @return change
*/
public String getChange() {
return this.change;
}
/**
* Value before the change.
* @return previousValue
*/
public java.util.List getPreviousValue() {
return this.previousValue;
}
/**
* Value after the change.
* @return nextValue
*/
public java.util.List getNextValue() {
return this.nextValue;
}
/**
* Address removed from billingAddressesIds
.
* @return address
*/
public com.commercetools.history.models.common.Address getAddress() {
return this.address;
}
/**
* builds RemoveBillingAddressIdChange with checking for non-null required values
* @return RemoveBillingAddressIdChange
*/
public RemoveBillingAddressIdChange build() {
Objects.requireNonNull(change, RemoveBillingAddressIdChange.class + ": change is missing");
Objects.requireNonNull(previousValue, RemoveBillingAddressIdChange.class + ": previousValue is missing");
Objects.requireNonNull(nextValue, RemoveBillingAddressIdChange.class + ": nextValue is missing");
Objects.requireNonNull(address, RemoveBillingAddressIdChange.class + ": address is missing");
return new RemoveBillingAddressIdChangeImpl(change, previousValue, nextValue, address);
}
/**
* builds RemoveBillingAddressIdChange without checking for non-null required values
* @return RemoveBillingAddressIdChange
*/
public RemoveBillingAddressIdChange buildUnchecked() {
return new RemoveBillingAddressIdChangeImpl(change, previousValue, nextValue, address);
}
/**
* factory method for an instance of RemoveBillingAddressIdChangeBuilder
* @return builder
*/
public static RemoveBillingAddressIdChangeBuilder of() {
return new RemoveBillingAddressIdChangeBuilder();
}
/**
* create builder for RemoveBillingAddressIdChange instance
* @param template instance with prefilled values for the builder
* @return builder
*/
public static RemoveBillingAddressIdChangeBuilder of(final RemoveBillingAddressIdChange template) {
RemoveBillingAddressIdChangeBuilder builder = new RemoveBillingAddressIdChangeBuilder();
builder.change = template.getChange();
builder.previousValue = template.getPreviousValue();
builder.nextValue = template.getNextValue();
builder.address = template.getAddress();
return builder;
}
}