com.commercetools.history.models.change.ChangeTextLineItemNameChangeBuilder 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;
/**
* ChangeTextLineItemNameChangeBuilder
*
* Example to create an instance using the builder pattern
*
*
* ChangeTextLineItemNameChange changeTextLineItemNameChange = ChangeTextLineItemNameChange.builder()
* .change("{change}")
* .previousValue(previousValueBuilder -> previousValueBuilder)
* .nextValue(nextValueBuilder -> nextValueBuilder)
* .textLineItem(textLineItemBuilder -> textLineItemBuilder)
* .build()
*
*
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class ChangeTextLineItemNameChangeBuilder 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.TextLineItemValue textLineItem;
/**
* set the value to the change
* @param change value to be set
* @return Builder
*/
public ChangeTextLineItemNameChangeBuilder change(final String change) {
this.change = change;
return this;
}
/**
* Value before the change.
* @param builder function to build the previousValue value
* @return Builder
*/
public ChangeTextLineItemNameChangeBuilder 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 ChangeTextLineItemNameChangeBuilder 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 ChangeTextLineItemNameChangeBuilder 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 ChangeTextLineItemNameChangeBuilder 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 ChangeTextLineItemNameChangeBuilder 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 ChangeTextLineItemNameChangeBuilder nextValue(
final com.commercetools.history.models.common.LocalizedString nextValue) {
this.nextValue = nextValue;
return this;
}
/**
* Holds information about the updated Text Line Item.
* @param builder function to build the textLineItem value
* @return Builder
*/
public ChangeTextLineItemNameChangeBuilder textLineItem(
Function builder) {
this.textLineItem = builder.apply(com.commercetools.history.models.change_value.TextLineItemValueBuilder.of())
.build();
return this;
}
/**
* Holds information about the updated Text Line Item.
* @param builder function to build the textLineItem value
* @return Builder
*/
public ChangeTextLineItemNameChangeBuilder withTextLineItem(
Function builder) {
this.textLineItem = builder.apply(com.commercetools.history.models.change_value.TextLineItemValueBuilder.of());
return this;
}
/**
* Holds information about the updated Text Line Item.
* @param textLineItem value to be set
* @return Builder
*/
public ChangeTextLineItemNameChangeBuilder textLineItem(
final com.commercetools.history.models.change_value.TextLineItemValue textLineItem) {
this.textLineItem = textLineItem;
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;
}
/**
* Holds information about the updated Text Line Item.
* @return textLineItem
*/
public com.commercetools.history.models.change_value.TextLineItemValue getTextLineItem() {
return this.textLineItem;
}
/**
* builds ChangeTextLineItemNameChange with checking for non-null required values
* @return ChangeTextLineItemNameChange
*/
public ChangeTextLineItemNameChange build() {
Objects.requireNonNull(change, ChangeTextLineItemNameChange.class + ": change is missing");
Objects.requireNonNull(previousValue, ChangeTextLineItemNameChange.class + ": previousValue is missing");
Objects.requireNonNull(nextValue, ChangeTextLineItemNameChange.class + ": nextValue is missing");
Objects.requireNonNull(textLineItem, ChangeTextLineItemNameChange.class + ": textLineItem is missing");
return new ChangeTextLineItemNameChangeImpl(change, previousValue, nextValue, textLineItem);
}
/**
* builds ChangeTextLineItemNameChange without checking for non-null required values
* @return ChangeTextLineItemNameChange
*/
public ChangeTextLineItemNameChange buildUnchecked() {
return new ChangeTextLineItemNameChangeImpl(change, previousValue, nextValue, textLineItem);
}
/**
* factory method for an instance of ChangeTextLineItemNameChangeBuilder
* @return builder
*/
public static ChangeTextLineItemNameChangeBuilder of() {
return new ChangeTextLineItemNameChangeBuilder();
}
/**
* create builder for ChangeTextLineItemNameChange instance
* @param template instance with prefilled values for the builder
* @return builder
*/
public static ChangeTextLineItemNameChangeBuilder of(final ChangeTextLineItemNameChange template) {
ChangeTextLineItemNameChangeBuilder builder = new ChangeTextLineItemNameChangeBuilder();
builder.change = template.getChange();
builder.previousValue = template.getPreviousValue();
builder.nextValue = template.getNextValue();
builder.textLineItem = template.getTextLineItem();
return builder;
}
}