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