All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.commercetools.history.models.change.AddFieldDefinitionChangeBuilder Maven / Gradle / Ivy

There is a newer version: 17.11.0
Show newest version

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;

/**
 * AddFieldDefinitionChangeBuilder
 * 
* Example to create an instance using the builder pattern *
*

 *     AddFieldDefinitionChange addFieldDefinitionChange = AddFieldDefinitionChange.builder()
 *             .change("{change}")
 *             .nextValue(nextValueBuilder -> nextValueBuilder)
 *             .build()
 * 
*
*/ @Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") public class AddFieldDefinitionChangeBuilder implements Builder { private String change; private com.commercetools.history.models.common.FieldDefinition nextValue; /** * set the value to the change * @param change value to be set * @return Builder */ public AddFieldDefinitionChangeBuilder change(final String change) { this.change = change; return this; } /** *

Value after the change.

* @param builder function to build the nextValue value * @return Builder */ public AddFieldDefinitionChangeBuilder nextValue( Function builder) { this.nextValue = builder.apply(com.commercetools.history.models.common.FieldDefinitionBuilder.of()).build(); return this; } /** *

Value after the change.

* @param builder function to build the nextValue value * @return Builder */ public AddFieldDefinitionChangeBuilder withNextValue( Function builder) { this.nextValue = builder.apply(com.commercetools.history.models.common.FieldDefinitionBuilder.of()); return this; } /** *

Value after the change.

* @param nextValue value to be set * @return Builder */ public AddFieldDefinitionChangeBuilder nextValue( final com.commercetools.history.models.common.FieldDefinition nextValue) { this.nextValue = nextValue; return this; } /** * value of change} * @return change */ public String getChange() { return this.change; } /** *

Value after the change.

* @return nextValue */ public com.commercetools.history.models.common.FieldDefinition getNextValue() { return this.nextValue; } /** * builds AddFieldDefinitionChange with checking for non-null required values * @return AddFieldDefinitionChange */ public AddFieldDefinitionChange build() { Objects.requireNonNull(change, AddFieldDefinitionChange.class + ": change is missing"); Objects.requireNonNull(nextValue, AddFieldDefinitionChange.class + ": nextValue is missing"); return new AddFieldDefinitionChangeImpl(change, nextValue); } /** * builds AddFieldDefinitionChange without checking for non-null required values * @return AddFieldDefinitionChange */ public AddFieldDefinitionChange buildUnchecked() { return new AddFieldDefinitionChangeImpl(change, nextValue); } /** * factory method for an instance of AddFieldDefinitionChangeBuilder * @return builder */ public static AddFieldDefinitionChangeBuilder of() { return new AddFieldDefinitionChangeBuilder(); } /** * create builder for AddFieldDefinitionChange instance * @param template instance with prefilled values for the builder * @return builder */ public static AddFieldDefinitionChangeBuilder of(final AddFieldDefinitionChange template) { AddFieldDefinitionChangeBuilder builder = new AddFieldDefinitionChangeBuilder(); builder.change = template.getChange(); builder.nextValue = template.getNextValue(); return builder; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy