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

com.commercetools.history.models.change.RemoveShippingAddressIdChangeBuilder Maven / Gradle / Ivy

There is a newer version: 17.15.1
Show newest version

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;

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

 *     RemoveShippingAddressIdChange removeShippingAddressIdChange = RemoveShippingAddressIdChange.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 RemoveShippingAddressIdChangeBuilder 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 RemoveShippingAddressIdChangeBuilder change(final String change) { this.change = change; return this; } /** *

Value before the change.

* @param previousValue value to be set * @return Builder */ public RemoveShippingAddressIdChangeBuilder 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 RemoveShippingAddressIdChangeBuilder previousValue(final java.util.List previousValue) { this.previousValue = previousValue; return this; } /** *

Value before the change.

* @param previousValue value to be set * @return Builder */ public RemoveShippingAddressIdChangeBuilder 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 RemoveShippingAddressIdChangeBuilder 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 RemoveShippingAddressIdChangeBuilder nextValue(final java.util.List nextValue) { this.nextValue = nextValue; return this; } /** *

Value after the change.

* @param nextValue value to be set * @return Builder */ public RemoveShippingAddressIdChangeBuilder plusNextValue(final String... nextValue) { if (this.nextValue == null) { this.nextValue = new ArrayList<>(); } this.nextValue.addAll(Arrays.asList(nextValue)); return this; } /** *

Address removed from shippingAddressesIds.

* @param builder function to build the address value * @return Builder */ public RemoveShippingAddressIdChangeBuilder address( Function builder) { this.address = builder.apply(com.commercetools.history.models.common.AddressBuilder.of()).build(); return this; } /** *

Address removed from shippingAddressesIds.

* @param builder function to build the address value * @return Builder */ public RemoveShippingAddressIdChangeBuilder withAddress( Function builder) { this.address = builder.apply(com.commercetools.history.models.common.AddressBuilder.of()); return this; } /** *

Address removed from shippingAddressesIds.

* @param address value to be set * @return Builder */ public RemoveShippingAddressIdChangeBuilder 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 shippingAddressesIds.

* @return address */ public com.commercetools.history.models.common.Address getAddress() { return this.address; } /** * builds RemoveShippingAddressIdChange with checking for non-null required values * @return RemoveShippingAddressIdChange */ public RemoveShippingAddressIdChange build() { Objects.requireNonNull(change, RemoveShippingAddressIdChange.class + ": change is missing"); Objects.requireNonNull(previousValue, RemoveShippingAddressIdChange.class + ": previousValue is missing"); Objects.requireNonNull(nextValue, RemoveShippingAddressIdChange.class + ": nextValue is missing"); Objects.requireNonNull(address, RemoveShippingAddressIdChange.class + ": address is missing"); return new RemoveShippingAddressIdChangeImpl(change, previousValue, nextValue, address); } /** * builds RemoveShippingAddressIdChange without checking for non-null required values * @return RemoveShippingAddressIdChange */ public RemoveShippingAddressIdChange buildUnchecked() { return new RemoveShippingAddressIdChangeImpl(change, previousValue, nextValue, address); } /** * factory method for an instance of RemoveShippingAddressIdChangeBuilder * @return builder */ public static RemoveShippingAddressIdChangeBuilder of() { return new RemoveShippingAddressIdChangeBuilder(); } /** * create builder for RemoveShippingAddressIdChange instance * @param template instance with prefilled values for the builder * @return builder */ public static RemoveShippingAddressIdChangeBuilder of(final RemoveShippingAddressIdChange template) { RemoveShippingAddressIdChangeBuilder builder = new RemoveShippingAddressIdChangeBuilder(); builder.change = template.getChange(); builder.previousValue = template.getPreviousValue(); builder.nextValue = template.getNextValue(); builder.address = template.getAddress(); return builder; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy