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

com.commercetools.history.models.change.AddParcelToDeliveryChangeBuilder 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;

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

 *     AddParcelToDeliveryChange addParcelToDeliveryChange = AddParcelToDeliveryChange.builder()
 *             .change("{change}")
 *             .nextValue(nextValueBuilder -> nextValueBuilder)
 *             .deliveryId("{deliveryId}")
 *             .build()
 * 
*
*/ @Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") public class AddParcelToDeliveryChangeBuilder implements Builder { private String change; private com.commercetools.history.models.common.Parcel nextValue; private String deliveryId; /** * set the value to the change * @param change value to be set * @return Builder */ public AddParcelToDeliveryChangeBuilder change(final String change) { this.change = change; return this; } /** *

Value after the change.

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

Value after the change.

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

Value after the change.

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

id of the Delivery to which the Parcel was added.

* @param deliveryId value to be set * @return Builder */ public AddParcelToDeliveryChangeBuilder deliveryId(final String deliveryId) { this.deliveryId = deliveryId; return this; } /** * value of change} * @return change */ public String getChange() { return this.change; } /** *

Value after the change.

* @return nextValue */ public com.commercetools.history.models.common.Parcel getNextValue() { return this.nextValue; } /** *

id of the Delivery to which the Parcel was added.

* @return deliveryId */ public String getDeliveryId() { return this.deliveryId; } /** * builds AddParcelToDeliveryChange with checking for non-null required values * @return AddParcelToDeliveryChange */ public AddParcelToDeliveryChange build() { Objects.requireNonNull(change, AddParcelToDeliveryChange.class + ": change is missing"); Objects.requireNonNull(nextValue, AddParcelToDeliveryChange.class + ": nextValue is missing"); Objects.requireNonNull(deliveryId, AddParcelToDeliveryChange.class + ": deliveryId is missing"); return new AddParcelToDeliveryChangeImpl(change, nextValue, deliveryId); } /** * builds AddParcelToDeliveryChange without checking for non-null required values * @return AddParcelToDeliveryChange */ public AddParcelToDeliveryChange buildUnchecked() { return new AddParcelToDeliveryChangeImpl(change, nextValue, deliveryId); } /** * factory method for an instance of AddParcelToDeliveryChangeBuilder * @return builder */ public static AddParcelToDeliveryChangeBuilder of() { return new AddParcelToDeliveryChangeBuilder(); } /** * create builder for AddParcelToDeliveryChange instance * @param template instance with prefilled values for the builder * @return builder */ public static AddParcelToDeliveryChangeBuilder of(final AddParcelToDeliveryChange template) { AddParcelToDeliveryChangeBuilder builder = new AddParcelToDeliveryChangeBuilder(); builder.change = template.getChange(); builder.nextValue = template.getNextValue(); builder.deliveryId = template.getDeliveryId(); return builder; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy