com.commercetools.history.models.change.ChangeTransactionTimestampChangeBuilder 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;
/**
* ChangeTransactionTimestampChangeBuilder
*
* Example to create an instance using the builder pattern
*
*
* ChangeTransactionTimestampChange changeTransactionTimestampChange = ChangeTransactionTimestampChange.builder()
* .change("{change}")
* .previousValue("{previousValue}")
* .nextValue("{nextValue}")
* .transaction(transactionBuilder -> transactionBuilder)
* .build()
*
*
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class ChangeTransactionTimestampChangeBuilder implements Builder {
private String change;
private String previousValue;
private String nextValue;
private com.commercetools.history.models.change_value.TransactionChangeValue transaction;
/**
* set the value to the change
* @param change value to be set
* @return Builder
*/
public ChangeTransactionTimestampChangeBuilder change(final String change) {
this.change = change;
return this;
}
/**
* Value before the change.
* @param previousValue value to be set
* @return Builder
*/
public ChangeTransactionTimestampChangeBuilder previousValue(final String previousValue) {
this.previousValue = previousValue;
return this;
}
/**
* Value after the change.
* @param nextValue value to be set
* @return Builder
*/
public ChangeTransactionTimestampChangeBuilder nextValue(final String nextValue) {
this.nextValue = nextValue;
return this;
}
/**
* Holds information about the updated Transaction.
* @param builder function to build the transaction value
* @return Builder
*/
public ChangeTransactionTimestampChangeBuilder transaction(
Function builder) {
this.transaction = builder
.apply(com.commercetools.history.models.change_value.TransactionChangeValueBuilder.of())
.build();
return this;
}
/**
* Holds information about the updated Transaction.
* @param builder function to build the transaction value
* @return Builder
*/
public ChangeTransactionTimestampChangeBuilder withTransaction(
Function builder) {
this.transaction = builder
.apply(com.commercetools.history.models.change_value.TransactionChangeValueBuilder.of());
return this;
}
/**
* Holds information about the updated Transaction.
* @param transaction value to be set
* @return Builder
*/
public ChangeTransactionTimestampChangeBuilder transaction(
final com.commercetools.history.models.change_value.TransactionChangeValue transaction) {
this.transaction = transaction;
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;
}
/**
* Holds information about the updated Transaction.
* @return transaction
*/
public com.commercetools.history.models.change_value.TransactionChangeValue getTransaction() {
return this.transaction;
}
/**
* builds ChangeTransactionTimestampChange with checking for non-null required values
* @return ChangeTransactionTimestampChange
*/
public ChangeTransactionTimestampChange build() {
Objects.requireNonNull(change, ChangeTransactionTimestampChange.class + ": change is missing");
Objects.requireNonNull(previousValue, ChangeTransactionTimestampChange.class + ": previousValue is missing");
Objects.requireNonNull(nextValue, ChangeTransactionTimestampChange.class + ": nextValue is missing");
Objects.requireNonNull(transaction, ChangeTransactionTimestampChange.class + ": transaction is missing");
return new ChangeTransactionTimestampChangeImpl(change, previousValue, nextValue, transaction);
}
/**
* builds ChangeTransactionTimestampChange without checking for non-null required values
* @return ChangeTransactionTimestampChange
*/
public ChangeTransactionTimestampChange buildUnchecked() {
return new ChangeTransactionTimestampChangeImpl(change, previousValue, nextValue, transaction);
}
/**
* factory method for an instance of ChangeTransactionTimestampChangeBuilder
* @return builder
*/
public static ChangeTransactionTimestampChangeBuilder of() {
return new ChangeTransactionTimestampChangeBuilder();
}
/**
* create builder for ChangeTransactionTimestampChange instance
* @param template instance with prefilled values for the builder
* @return builder
*/
public static ChangeTransactionTimestampChangeBuilder of(final ChangeTransactionTimestampChange template) {
ChangeTransactionTimestampChangeBuilder builder = new ChangeTransactionTimestampChangeBuilder();
builder.change = template.getChange();
builder.previousValue = template.getPreviousValue();
builder.nextValue = template.getNextValue();
builder.transaction = template.getTransaction();
return builder;
}
}