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

com.commercetools.history.models.change_value.ChangeValueAbsoluteChangeValueBuilder Maven / Gradle / Ivy

There is a newer version: 17.15.1
Show newest version

package com.commercetools.history.models.change_value;

import java.util.*;
import java.util.function.Function;

import io.vrap.rmf.base.client.Builder;
import io.vrap.rmf.base.client.utils.Generated;

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

 *     ChangeValueAbsoluteChangeValue changeValueAbsoluteChangeValue = ChangeValueAbsoluteChangeValue.builder()
 *             .plusMoney(moneyBuilder -> moneyBuilder)
 *             .build()
 * 
*
*/ @Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") public class ChangeValueAbsoluteChangeValueBuilder implements Builder { private java.util.List money; /** *

Money values in different currencies.

* @param money value to be set * @return Builder */ public ChangeValueAbsoluteChangeValueBuilder money(final com.commercetools.history.models.common.Money... money) { this.money = new ArrayList<>(Arrays.asList(money)); return this; } /** *

Money values in different currencies.

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

Money values in different currencies.

* @param money value to be set * @return Builder */ public ChangeValueAbsoluteChangeValueBuilder plusMoney( final com.commercetools.history.models.common.Money... money) { if (this.money == null) { this.money = new ArrayList<>(); } this.money.addAll(Arrays.asList(money)); return this; } /** *

Money values in different currencies.

* @param builder function to build the money value * @return Builder */ public ChangeValueAbsoluteChangeValueBuilder plusMoney( Function builder) { if (this.money == null) { this.money = new ArrayList<>(); } this.money.add(builder.apply(com.commercetools.history.models.common.MoneyBuilder.of()).build()); return this; } /** *

Money values in different currencies.

* @param builder function to build the money value * @return Builder */ public ChangeValueAbsoluteChangeValueBuilder withMoney( Function builder) { this.money = new ArrayList<>(); this.money.add(builder.apply(com.commercetools.history.models.common.MoneyBuilder.of()).build()); return this; } /** *

Money values in different currencies.

* @param builder function to build the money value * @return Builder */ public ChangeValueAbsoluteChangeValueBuilder addMoney( Function builder) { return plusMoney(builder.apply(com.commercetools.history.models.common.MoneyBuilder.of())); } /** *

Money values in different currencies.

* @param builder function to build the money value * @return Builder */ public ChangeValueAbsoluteChangeValueBuilder setMoney( Function builder) { return money(builder.apply(com.commercetools.history.models.common.MoneyBuilder.of())); } /** *

Money values in different currencies.

* @return money */ public java.util.List getMoney() { return this.money; } /** * builds ChangeValueAbsoluteChangeValue with checking for non-null required values * @return ChangeValueAbsoluteChangeValue */ public ChangeValueAbsoluteChangeValue build() { Objects.requireNonNull(money, ChangeValueAbsoluteChangeValue.class + ": money is missing"); return new ChangeValueAbsoluteChangeValueImpl(money); } /** * builds ChangeValueAbsoluteChangeValue without checking for non-null required values * @return ChangeValueAbsoluteChangeValue */ public ChangeValueAbsoluteChangeValue buildUnchecked() { return new ChangeValueAbsoluteChangeValueImpl(money); } /** * factory method for an instance of ChangeValueAbsoluteChangeValueBuilder * @return builder */ public static ChangeValueAbsoluteChangeValueBuilder of() { return new ChangeValueAbsoluteChangeValueBuilder(); } /** * create builder for ChangeValueAbsoluteChangeValue instance * @param template instance with prefilled values for the builder * @return builder */ public static ChangeValueAbsoluteChangeValueBuilder of(final ChangeValueAbsoluteChangeValue template) { ChangeValueAbsoluteChangeValueBuilder builder = new ChangeValueAbsoluteChangeValueBuilder(); builder.money = template.getMoney(); return builder; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy