001
002package com.commercetools.api.models.store;
003
004import java.util.*;
005import java.util.function.Function;
006
007import io.vrap.rmf.base.client.Builder;
008import io.vrap.rmf.base.client.utils.Generated;
009
010/**
011 * StoreAddSupplyChannelActionBuilder
012 * <hr>
013 * Example to create an instance using the builder pattern
014 * <div class=code-example>
015 * <pre><code class='java'>
016 *     StoreAddSupplyChannelAction storeAddSupplyChannelAction = StoreAddSupplyChannelAction.builder()
017 *             .supplyChannel(supplyChannelBuilder -> supplyChannelBuilder)
018 *             .build()
019 * </code></pre>
020 * </div>
021 */
022@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
023public class StoreAddSupplyChannelActionBuilder implements Builder<StoreAddSupplyChannelAction> {
024
025    private com.commercetools.api.models.channel.ChannelResourceIdentifier supplyChannel;
026
027    /**
028     *  <p>Value to append.</p>
029     * @param builder function to build the supplyChannel value
030     * @return Builder
031     */
032
033    public StoreAddSupplyChannelActionBuilder supplyChannel(
034            Function<com.commercetools.api.models.channel.ChannelResourceIdentifierBuilder, com.commercetools.api.models.channel.ChannelResourceIdentifierBuilder> builder) {
035        this.supplyChannel = builder.apply(com.commercetools.api.models.channel.ChannelResourceIdentifierBuilder.of())
036                .build();
037        return this;
038    }
039
040    /**
041     *  <p>Value to append.</p>
042     * @param builder function to build the supplyChannel value
043     * @return Builder
044     */
045
046    public StoreAddSupplyChannelActionBuilder withSupplyChannel(
047            Function<com.commercetools.api.models.channel.ChannelResourceIdentifierBuilder, com.commercetools.api.models.channel.ChannelResourceIdentifier> builder) {
048        this.supplyChannel = builder.apply(com.commercetools.api.models.channel.ChannelResourceIdentifierBuilder.of());
049        return this;
050    }
051
052    /**
053     *  <p>Value to append.</p>
054     * @param supplyChannel value to be set
055     * @return Builder
056     */
057
058    public StoreAddSupplyChannelActionBuilder supplyChannel(
059            final com.commercetools.api.models.channel.ChannelResourceIdentifier supplyChannel) {
060        this.supplyChannel = supplyChannel;
061        return this;
062    }
063
064    /**
065     *  <p>Value to append.</p>
066     * @return supplyChannel
067     */
068
069    public com.commercetools.api.models.channel.ChannelResourceIdentifier getSupplyChannel() {
070        return this.supplyChannel;
071    }
072
073    /**
074     * builds StoreAddSupplyChannelAction with checking for non-null required values
075     * @return StoreAddSupplyChannelAction
076     */
077    public StoreAddSupplyChannelAction build() {
078        Objects.requireNonNull(supplyChannel, StoreAddSupplyChannelAction.class + ": supplyChannel is missing");
079        return new StoreAddSupplyChannelActionImpl(supplyChannel);
080    }
081
082    /**
083     * builds StoreAddSupplyChannelAction without checking for non-null required values
084     * @return StoreAddSupplyChannelAction
085     */
086    public StoreAddSupplyChannelAction buildUnchecked() {
087        return new StoreAddSupplyChannelActionImpl(supplyChannel);
088    }
089
090    /**
091     * factory method for an instance of StoreAddSupplyChannelActionBuilder
092     * @return builder
093     */
094    public static StoreAddSupplyChannelActionBuilder of() {
095        return new StoreAddSupplyChannelActionBuilder();
096    }
097
098    /**
099     * create builder for StoreAddSupplyChannelAction instance
100     * @param template instance with prefilled values for the builder
101     * @return builder
102     */
103    public static StoreAddSupplyChannelActionBuilder of(final StoreAddSupplyChannelAction template) {
104        StoreAddSupplyChannelActionBuilder builder = new StoreAddSupplyChannelActionBuilder();
105        builder.supplyChannel = template.getSupplyChannel();
106        return builder;
107    }
108
109}