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

com.commercetools.history.models.change.AddEnumValueChangeBuilder 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;

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

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

Value after the change.

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

Value after the change.

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

Value after the change.

* @param nextValue value to be set * @return Builder */ public AddEnumValueChangeBuilder nextValue( final com.commercetools.history.models.change_value.EnumValue nextValue) { this.nextValue = nextValue; return this; } /** *

Name of the updated FieldDefinition.

* @param fieldName value to be set * @return Builder */ public AddEnumValueChangeBuilder fieldName(final String fieldName) { this.fieldName = fieldName; return this; } /** * value of change} * @return change */ public String getChange() { return this.change; } /** *

Value after the change.

* @return nextValue */ public com.commercetools.history.models.change_value.EnumValue getNextValue() { return this.nextValue; } /** *

Name of the updated FieldDefinition.

* @return fieldName */ public String getFieldName() { return this.fieldName; } /** * builds AddEnumValueChange with checking for non-null required values * @return AddEnumValueChange */ public AddEnumValueChange build() { Objects.requireNonNull(change, AddEnumValueChange.class + ": change is missing"); Objects.requireNonNull(nextValue, AddEnumValueChange.class + ": nextValue is missing"); Objects.requireNonNull(fieldName, AddEnumValueChange.class + ": fieldName is missing"); return new AddEnumValueChangeImpl(change, nextValue, fieldName); } /** * builds AddEnumValueChange without checking for non-null required values * @return AddEnumValueChange */ public AddEnumValueChange buildUnchecked() { return new AddEnumValueChangeImpl(change, nextValue, fieldName); } /** * factory method for an instance of AddEnumValueChangeBuilder * @return builder */ public static AddEnumValueChangeBuilder of() { return new AddEnumValueChangeBuilder(); } /** * create builder for AddEnumValueChange instance * @param template instance with prefilled values for the builder * @return builder */ public static AddEnumValueChangeBuilder of(final AddEnumValueChange template) { AddEnumValueChangeBuilder builder = new AddEnumValueChangeBuilder(); builder.change = template.getChange(); builder.nextValue = template.getNextValue(); builder.fieldName = template.getFieldName(); return builder; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy