com.commercetools.history.models.change.SetParcelTrackingDataChangeBuilder 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;
/**
* SetParcelTrackingDataChangeBuilder
*
* Example to create an instance using the builder pattern
*
*
* SetParcelTrackingDataChange setParcelTrackingDataChange = SetParcelTrackingDataChange.builder()
* .change("{change}")
* .previousValue(previousValueBuilder -> previousValueBuilder)
* .nextValue(nextValueBuilder -> nextValueBuilder)
* .parcel(parcelBuilder -> parcelBuilder)
* .build()
*
*
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class SetParcelTrackingDataChangeBuilder implements Builder {
private String change;
private com.commercetools.history.models.common.TrackingData previousValue;
private com.commercetools.history.models.common.TrackingData nextValue;
private com.commercetools.history.models.change_value.ParcelChangeValue parcel;
/**
* set the value to the change
* @param change value to be set
* @return Builder
*/
public SetParcelTrackingDataChangeBuilder change(final String change) {
this.change = change;
return this;
}
/**
* Value before the change.
* @param builder function to build the previousValue value
* @return Builder
*/
public SetParcelTrackingDataChangeBuilder previousValue(
Function builder) {
this.previousValue = builder.apply(com.commercetools.history.models.common.TrackingDataBuilder.of()).build();
return this;
}
/**
* Value before the change.
* @param builder function to build the previousValue value
* @return Builder
*/
public SetParcelTrackingDataChangeBuilder withPreviousValue(
Function builder) {
this.previousValue = builder.apply(com.commercetools.history.models.common.TrackingDataBuilder.of());
return this;
}
/**
* Value before the change.
* @param previousValue value to be set
* @return Builder
*/
public SetParcelTrackingDataChangeBuilder previousValue(
final com.commercetools.history.models.common.TrackingData previousValue) {
this.previousValue = previousValue;
return this;
}
/**
* Value after the change.
* @param builder function to build the nextValue value
* @return Builder
*/
public SetParcelTrackingDataChangeBuilder nextValue(
Function builder) {
this.nextValue = builder.apply(com.commercetools.history.models.common.TrackingDataBuilder.of()).build();
return this;
}
/**
* Value after the change.
* @param builder function to build the nextValue value
* @return Builder
*/
public SetParcelTrackingDataChangeBuilder withNextValue(
Function builder) {
this.nextValue = builder.apply(com.commercetools.history.models.common.TrackingDataBuilder.of());
return this;
}
/**
* Value after the change.
* @param nextValue value to be set
* @return Builder
*/
public SetParcelTrackingDataChangeBuilder nextValue(
final com.commercetools.history.models.common.TrackingData nextValue) {
this.nextValue = nextValue;
return this;
}
/**
* Information about the updated Parcel.
* @param builder function to build the parcel value
* @return Builder
*/
public SetParcelTrackingDataChangeBuilder parcel(
Function builder) {
this.parcel = builder.apply(com.commercetools.history.models.change_value.ParcelChangeValueBuilder.of())
.build();
return this;
}
/**
* Information about the updated Parcel.
* @param builder function to build the parcel value
* @return Builder
*/
public SetParcelTrackingDataChangeBuilder withParcel(
Function builder) {
this.parcel = builder.apply(com.commercetools.history.models.change_value.ParcelChangeValueBuilder.of());
return this;
}
/**
* Information about the updated Parcel.
* @param parcel value to be set
* @return Builder
*/
public SetParcelTrackingDataChangeBuilder parcel(
final com.commercetools.history.models.change_value.ParcelChangeValue parcel) {
this.parcel = parcel;
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.TrackingData getPreviousValue() {
return this.previousValue;
}
/**
* Value after the change.
* @return nextValue
*/
public com.commercetools.history.models.common.TrackingData getNextValue() {
return this.nextValue;
}
/**
* Information about the updated Parcel.
* @return parcel
*/
public com.commercetools.history.models.change_value.ParcelChangeValue getParcel() {
return this.parcel;
}
/**
* builds SetParcelTrackingDataChange with checking for non-null required values
* @return SetParcelTrackingDataChange
*/
public SetParcelTrackingDataChange build() {
Objects.requireNonNull(change, SetParcelTrackingDataChange.class + ": change is missing");
Objects.requireNonNull(previousValue, SetParcelTrackingDataChange.class + ": previousValue is missing");
Objects.requireNonNull(nextValue, SetParcelTrackingDataChange.class + ": nextValue is missing");
Objects.requireNonNull(parcel, SetParcelTrackingDataChange.class + ": parcel is missing");
return new SetParcelTrackingDataChangeImpl(change, previousValue, nextValue, parcel);
}
/**
* builds SetParcelTrackingDataChange without checking for non-null required values
* @return SetParcelTrackingDataChange
*/
public SetParcelTrackingDataChange buildUnchecked() {
return new SetParcelTrackingDataChangeImpl(change, previousValue, nextValue, parcel);
}
/**
* factory method for an instance of SetParcelTrackingDataChangeBuilder
* @return builder
*/
public static SetParcelTrackingDataChangeBuilder of() {
return new SetParcelTrackingDataChangeBuilder();
}
/**
* create builder for SetParcelTrackingDataChange instance
* @param template instance with prefilled values for the builder
* @return builder
*/
public static SetParcelTrackingDataChangeBuilder of(final SetParcelTrackingDataChange template) {
SetParcelTrackingDataChangeBuilder builder = new SetParcelTrackingDataChangeBuilder();
builder.change = template.getChange();
builder.previousValue = template.getPreviousValue();
builder.nextValue = template.getNextValue();
builder.parcel = template.getParcel();
return builder;
}
}