com.commercetools.history.models.change.SetAssetDescriptionChangeBuilder 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;
/**
* SetAssetDescriptionChangeBuilder
*
* Example to create an instance using the builder pattern
*
*
* SetAssetDescriptionChange setAssetDescriptionChange = SetAssetDescriptionChange.builder()
* .change("{change}")
* .previousValue(previousValueBuilder -> previousValueBuilder)
* .nextValue(nextValueBuilder -> nextValueBuilder)
* .asset(assetBuilder -> assetBuilder)
* .build()
*
*
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class SetAssetDescriptionChangeBuilder implements Builder {
private String change;
private com.commercetools.history.models.common.LocalizedString previousValue;
private com.commercetools.history.models.common.LocalizedString nextValue;
private com.commercetools.history.models.change_value.AssetChangeValue asset;
/**
* set the value to the change
* @param change value to be set
* @return Builder
*/
public SetAssetDescriptionChangeBuilder change(final String change) {
this.change = change;
return this;
}
/**
* Value before the change.
* @param builder function to build the previousValue value
* @return Builder
*/
public SetAssetDescriptionChangeBuilder previousValue(
Function builder) {
this.previousValue = builder.apply(com.commercetools.history.models.common.LocalizedStringBuilder.of()).build();
return this;
}
/**
* Value before the change.
* @param builder function to build the previousValue value
* @return Builder
*/
public SetAssetDescriptionChangeBuilder withPreviousValue(
Function builder) {
this.previousValue = builder.apply(com.commercetools.history.models.common.LocalizedStringBuilder.of());
return this;
}
/**
* Value before the change.
* @param previousValue value to be set
* @return Builder
*/
public SetAssetDescriptionChangeBuilder previousValue(
final com.commercetools.history.models.common.LocalizedString previousValue) {
this.previousValue = previousValue;
return this;
}
/**
* Value after the change.
* @param builder function to build the nextValue value
* @return Builder
*/
public SetAssetDescriptionChangeBuilder nextValue(
Function builder) {
this.nextValue = builder.apply(com.commercetools.history.models.common.LocalizedStringBuilder.of()).build();
return this;
}
/**
* Value after the change.
* @param builder function to build the nextValue value
* @return Builder
*/
public SetAssetDescriptionChangeBuilder withNextValue(
Function builder) {
this.nextValue = builder.apply(com.commercetools.history.models.common.LocalizedStringBuilder.of());
return this;
}
/**
* Value after the change.
* @param nextValue value to be set
* @return Builder
*/
public SetAssetDescriptionChangeBuilder nextValue(
final com.commercetools.history.models.common.LocalizedString nextValue) {
this.nextValue = nextValue;
return this;
}
/**
* Information about the updated Asset.
* @param builder function to build the asset value
* @return Builder
*/
public SetAssetDescriptionChangeBuilder asset(
Function builder) {
this.asset = builder.apply(com.commercetools.history.models.change_value.AssetChangeValueBuilder.of()).build();
return this;
}
/**
* Information about the updated Asset.
* @param builder function to build the asset value
* @return Builder
*/
public SetAssetDescriptionChangeBuilder withAsset(
Function builder) {
this.asset = builder.apply(com.commercetools.history.models.change_value.AssetChangeValueBuilder.of());
return this;
}
/**
* Information about the updated Asset.
* @param asset value to be set
* @return Builder
*/
public SetAssetDescriptionChangeBuilder asset(
final com.commercetools.history.models.change_value.AssetChangeValue asset) {
this.asset = asset;
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.LocalizedString getPreviousValue() {
return this.previousValue;
}
/**
* Value after the change.
* @return nextValue
*/
public com.commercetools.history.models.common.LocalizedString getNextValue() {
return this.nextValue;
}
/**
* Information about the updated Asset.
* @return asset
*/
public com.commercetools.history.models.change_value.AssetChangeValue getAsset() {
return this.asset;
}
/**
* builds SetAssetDescriptionChange with checking for non-null required values
* @return SetAssetDescriptionChange
*/
public SetAssetDescriptionChange build() {
Objects.requireNonNull(change, SetAssetDescriptionChange.class + ": change is missing");
Objects.requireNonNull(previousValue, SetAssetDescriptionChange.class + ": previousValue is missing");
Objects.requireNonNull(nextValue, SetAssetDescriptionChange.class + ": nextValue is missing");
Objects.requireNonNull(asset, SetAssetDescriptionChange.class + ": asset is missing");
return new SetAssetDescriptionChangeImpl(change, previousValue, nextValue, asset);
}
/**
* builds SetAssetDescriptionChange without checking for non-null required values
* @return SetAssetDescriptionChange
*/
public SetAssetDescriptionChange buildUnchecked() {
return new SetAssetDescriptionChangeImpl(change, previousValue, nextValue, asset);
}
/**
* factory method for an instance of SetAssetDescriptionChangeBuilder
* @return builder
*/
public static SetAssetDescriptionChangeBuilder of() {
return new SetAssetDescriptionChangeBuilder();
}
/**
* create builder for SetAssetDescriptionChange instance
* @param template instance with prefilled values for the builder
* @return builder
*/
public static SetAssetDescriptionChangeBuilder of(final SetAssetDescriptionChange template) {
SetAssetDescriptionChangeBuilder builder = new SetAssetDescriptionChangeBuilder();
builder.change = template.getChange();
builder.previousValue = template.getPreviousValue();
builder.nextValue = template.getNextValue();
builder.asset = template.getAsset();
return builder;
}
}