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