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