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

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

There is a newer version: 17.15.1
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;

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

 *     ChangeLocalizedEnumValueOrderChange changeLocalizedEnumValueOrderChange = ChangeLocalizedEnumValueOrderChange.builder()
 *             .change("{change}")
 *             .plusPreviousValue(previousValueBuilder -> previousValueBuilder)
 *             .plusNextValue(nextValueBuilder -> nextValueBuilder)
 *             .fieldName("{fieldName}")
 *             .attributeName("{attributeName}")
 *             .build()
 * 
*
*/ @Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") public class ChangeLocalizedEnumValueOrderChangeBuilder implements Builder { private String change; private java.util.List previousValue; private java.util.List nextValue; private String fieldName; private String attributeName; /** * set the value to the change * @param change value to be set * @return Builder */ public ChangeLocalizedEnumValueOrderChangeBuilder change(final String change) { this.change = change; return this; } /** *

Value before the change.

* @param previousValue value to be set * @return Builder */ public ChangeLocalizedEnumValueOrderChangeBuilder previousValue( final com.commercetools.history.models.change_value.LocalizedEnumValue... previousValue) { this.previousValue = new ArrayList<>(Arrays.asList(previousValue)); return this; } /** *

Value before the change.

* @param previousValue value to be set * @return Builder */ public ChangeLocalizedEnumValueOrderChangeBuilder previousValue( final java.util.List previousValue) { this.previousValue = previousValue; return this; } /** *

Value before the change.

* @param previousValue value to be set * @return Builder */ public ChangeLocalizedEnumValueOrderChangeBuilder plusPreviousValue( final com.commercetools.history.models.change_value.LocalizedEnumValue... previousValue) { if (this.previousValue == null) { this.previousValue = new ArrayList<>(); } this.previousValue.addAll(Arrays.asList(previousValue)); return this; } /** *

Value before the change.

* @param builder function to build the previousValue value * @return Builder */ public ChangeLocalizedEnumValueOrderChangeBuilder plusPreviousValue( Function builder) { if (this.previousValue == null) { this.previousValue = new ArrayList<>(); } this.previousValue.add( builder.apply(com.commercetools.history.models.change_value.LocalizedEnumValueBuilder.of()).build()); return this; } /** *

Value before the change.

* @param builder function to build the previousValue value * @return Builder */ public ChangeLocalizedEnumValueOrderChangeBuilder withPreviousValue( Function builder) { this.previousValue = new ArrayList<>(); this.previousValue.add( builder.apply(com.commercetools.history.models.change_value.LocalizedEnumValueBuilder.of()).build()); return this; } /** *

Value before the change.

* @param builder function to build the previousValue value * @return Builder */ public ChangeLocalizedEnumValueOrderChangeBuilder addPreviousValue( Function builder) { return plusPreviousValue( builder.apply(com.commercetools.history.models.change_value.LocalizedEnumValueBuilder.of())); } /** *

Value before the change.

* @param builder function to build the previousValue value * @return Builder */ public ChangeLocalizedEnumValueOrderChangeBuilder setPreviousValue( Function builder) { return previousValue( builder.apply(com.commercetools.history.models.change_value.LocalizedEnumValueBuilder.of())); } /** *

Value after the change.

* @param nextValue value to be set * @return Builder */ public ChangeLocalizedEnumValueOrderChangeBuilder nextValue( final com.commercetools.history.models.change_value.LocalizedEnumValue... nextValue) { this.nextValue = new ArrayList<>(Arrays.asList(nextValue)); return this; } /** *

Value after the change.

* @param nextValue value to be set * @return Builder */ public ChangeLocalizedEnumValueOrderChangeBuilder nextValue( final java.util.List nextValue) { this.nextValue = nextValue; return this; } /** *

Value after the change.

* @param nextValue value to be set * @return Builder */ public ChangeLocalizedEnumValueOrderChangeBuilder plusNextValue( final com.commercetools.history.models.change_value.LocalizedEnumValue... nextValue) { if (this.nextValue == null) { this.nextValue = new ArrayList<>(); } this.nextValue.addAll(Arrays.asList(nextValue)); return this; } /** *

Value after the change.

* @param builder function to build the nextValue value * @return Builder */ public ChangeLocalizedEnumValueOrderChangeBuilder plusNextValue( Function builder) { if (this.nextValue == null) { this.nextValue = new ArrayList<>(); } this.nextValue.add( builder.apply(com.commercetools.history.models.change_value.LocalizedEnumValueBuilder.of()).build()); return this; } /** *

Value after the change.

* @param builder function to build the nextValue value * @return Builder */ public ChangeLocalizedEnumValueOrderChangeBuilder withNextValue( Function builder) { this.nextValue = new ArrayList<>(); this.nextValue.add( builder.apply(com.commercetools.history.models.change_value.LocalizedEnumValueBuilder.of()).build()); return this; } /** *

Value after the change.

* @param builder function to build the nextValue value * @return Builder */ public ChangeLocalizedEnumValueOrderChangeBuilder addNextValue( Function builder) { return plusNextValue( builder.apply(com.commercetools.history.models.change_value.LocalizedEnumValueBuilder.of())); } /** *

Value after the change.

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

Name of the updated FieldDefinition; only present on changes to Types.

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

Name of the updated AttributeDefinition; only present on changes to Product Types.

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

Value before the change.

* @return previousValue */ public java.util.List getPreviousValue() { return this.previousValue; } /** *

Value after the change.

* @return nextValue */ public java.util.List getNextValue() { return this.nextValue; } /** *

Name of the updated FieldDefinition; only present on changes to Types.

* @return fieldName */ public String getFieldName() { return this.fieldName; } /** *

Name of the updated AttributeDefinition; only present on changes to Product Types.

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy