com.commercetools.history.models.change.ChangeEnumValueLabelChangeBuilder 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 io.vrap.rmf.base.client.Builder;
import io.vrap.rmf.base.client.utils.Generated;
/**
* ChangeEnumValueLabelChangeBuilder
*
* Example to create an instance using the builder pattern
*
*
* ChangeEnumValueLabelChange changeEnumValueLabelChange = ChangeEnumValueLabelChange.builder()
* .change("{change}")
* .previousValue("{previousValue}")
* .nextValue("{nextValue}")
* .fieldName("{fieldName}")
* .valueKey("{valueKey}")
* .build()
*
*
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class ChangeEnumValueLabelChangeBuilder implements Builder {
private String change;
private String previousValue;
private String nextValue;
private String fieldName;
private String valueKey;
/**
* set the value to the change
* @param change value to be set
* @return Builder
*/
public ChangeEnumValueLabelChangeBuilder change(final String change) {
this.change = change;
return this;
}
/**
* Value before the change.
* @param previousValue value to be set
* @return Builder
*/
public ChangeEnumValueLabelChangeBuilder previousValue(final String previousValue) {
this.previousValue = previousValue;
return this;
}
/**
* Value after the change.
* @param nextValue value to be set
* @return Builder
*/
public ChangeEnumValueLabelChangeBuilder nextValue(final String nextValue) {
this.nextValue = nextValue;
return this;
}
/**
* Name of the updated FieldDefinition.
* @param fieldName value to be set
* @return Builder
*/
public ChangeEnumValueLabelChangeBuilder fieldName(final String fieldName) {
this.fieldName = fieldName;
return this;
}
/**
* Key of the updated values.
* @param valueKey value to be set
* @return Builder
*/
public ChangeEnumValueLabelChangeBuilder valueKey(final String valueKey) {
this.valueKey = valueKey;
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;
}
/**
* Name of the updated FieldDefinition.
* @return fieldName
*/
public String getFieldName() {
return this.fieldName;
}
/**
* Key of the updated values.
* @return valueKey
*/
public String getValueKey() {
return this.valueKey;
}
/**
* builds ChangeEnumValueLabelChange with checking for non-null required values
* @return ChangeEnumValueLabelChange
*/
public ChangeEnumValueLabelChange build() {
Objects.requireNonNull(change, ChangeEnumValueLabelChange.class + ": change is missing");
Objects.requireNonNull(previousValue, ChangeEnumValueLabelChange.class + ": previousValue is missing");
Objects.requireNonNull(nextValue, ChangeEnumValueLabelChange.class + ": nextValue is missing");
Objects.requireNonNull(fieldName, ChangeEnumValueLabelChange.class + ": fieldName is missing");
Objects.requireNonNull(valueKey, ChangeEnumValueLabelChange.class + ": valueKey is missing");
return new ChangeEnumValueLabelChangeImpl(change, previousValue, nextValue, fieldName, valueKey);
}
/**
* builds ChangeEnumValueLabelChange without checking for non-null required values
* @return ChangeEnumValueLabelChange
*/
public ChangeEnumValueLabelChange buildUnchecked() {
return new ChangeEnumValueLabelChangeImpl(change, previousValue, nextValue, fieldName, valueKey);
}
/**
* factory method for an instance of ChangeEnumValueLabelChangeBuilder
* @return builder
*/
public static ChangeEnumValueLabelChangeBuilder of() {
return new ChangeEnumValueLabelChangeBuilder();
}
/**
* create builder for ChangeEnumValueLabelChange instance
* @param template instance with prefilled values for the builder
* @return builder
*/
public static ChangeEnumValueLabelChangeBuilder of(final ChangeEnumValueLabelChange template) {
ChangeEnumValueLabelChangeBuilder builder = new ChangeEnumValueLabelChangeBuilder();
builder.change = template.getChange();
builder.previousValue = template.getPreviousValue();
builder.nextValue = template.getNextValue();
builder.fieldName = template.getFieldName();
builder.valueKey = template.getValueKey();
return builder;
}
}