001
002package com.commercetools.api.models.me;
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 * MyCartSetShippingAddressActionBuilder
014 * <hr>
015 * Example to create an instance using the builder pattern
016 * <div class=code-example>
017 * <pre><code class='java'>
018 *     MyCartSetShippingAddressAction myCartSetShippingAddressAction = MyCartSetShippingAddressAction.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 MyCartSetShippingAddressActionBuilder implements Builder<MyCartSetShippingAddressAction> {
025
026    @Nullable
027    private com.commercetools.api.models.common.BaseAddress address;
028
029    /**
030     *  <p>Value to set. If not set, the shipping address is unset, and the <code>taxedPrice</code> and <code>taxRate</code> are unset in all Line Items.</p>
031     * @param builder function to build the address value
032     * @return Builder
033     */
034
035    public MyCartSetShippingAddressActionBuilder address(
036            Function<com.commercetools.api.models.common.BaseAddressBuilder, com.commercetools.api.models.common.BaseAddressBuilder> builder) {
037        this.address = builder.apply(com.commercetools.api.models.common.BaseAddressBuilder.of()).build();
038        return this;
039    }
040
041    /**
042     *  <p>Value to set. If not set, the shipping address is unset, and the <code>taxedPrice</code> and <code>taxRate</code> are unset in all Line Items.</p>
043     * @param builder function to build the address value
044     * @return Builder
045     */
046
047    public MyCartSetShippingAddressActionBuilder withAddress(
048            Function<com.commercetools.api.models.common.BaseAddressBuilder, com.commercetools.api.models.common.BaseAddress> builder) {
049        this.address = builder.apply(com.commercetools.api.models.common.BaseAddressBuilder.of());
050        return this;
051    }
052
053    /**
054     *  <p>Value to set. If not set, the shipping address is unset, and the <code>taxedPrice</code> and <code>taxRate</code> are unset in all Line Items.</p>
055     * @param address value to be set
056     * @return Builder
057     */
058
059    public MyCartSetShippingAddressActionBuilder address(
060            @Nullable final com.commercetools.api.models.common.BaseAddress address) {
061        this.address = address;
062        return this;
063    }
064
065    /**
066     *  <p>Value to set. If not set, the shipping address is unset, and the <code>taxedPrice</code> and <code>taxRate</code> are unset in all Line Items.</p>
067     * @return address
068     */
069
070    @Nullable
071    public com.commercetools.api.models.common.BaseAddress getAddress() {
072        return this.address;
073    }
074
075    /**
076     * builds MyCartSetShippingAddressAction with checking for non-null required values
077     * @return MyCartSetShippingAddressAction
078     */
079    public MyCartSetShippingAddressAction build() {
080        return new MyCartSetShippingAddressActionImpl(address);
081    }
082
083    /**
084     * builds MyCartSetShippingAddressAction without checking for non-null required values
085     * @return MyCartSetShippingAddressAction
086     */
087    public MyCartSetShippingAddressAction buildUnchecked() {
088        return new MyCartSetShippingAddressActionImpl(address);
089    }
090
091    /**
092     * factory method for an instance of MyCartSetShippingAddressActionBuilder
093     * @return builder
094     */
095    public static MyCartSetShippingAddressActionBuilder of() {
096        return new MyCartSetShippingAddressActionBuilder();
097    }
098
099    /**
100     * create builder for MyCartSetShippingAddressAction instance
101     * @param template instance with prefilled values for the builder
102     * @return builder
103     */
104    public static MyCartSetShippingAddressActionBuilder of(final MyCartSetShippingAddressAction template) {
105        MyCartSetShippingAddressActionBuilder builder = new MyCartSetShippingAddressActionBuilder();
106        builder.address = template.getAddress();
107        return builder;
108    }
109
110}