001
002package com.commercetools.api.models.customer_group;
003
004import java.util.*;
005
006import javax.annotation.Nullable;
007
008import io.vrap.rmf.base.client.Builder;
009import io.vrap.rmf.base.client.utils.Generated;
010
011/**
012 * CustomerGroupResourceIdentifierBuilder
013 * <hr>
014 * Example to create an instance using the builder pattern
015 * <div class=code-example>
016 * <pre><code class='java'>
017 *     CustomerGroupResourceIdentifier customerGroupResourceIdentifier = CustomerGroupResourceIdentifier.builder()
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 CustomerGroupResourceIdentifierBuilder implements Builder<CustomerGroupResourceIdentifier> {
024
025    @Nullable
026    private String id;
027
028    @Nullable
029    private String key;
030
031    /**
032     *  <p>Unique identifier of the referenced CustomerGroup. Either <code>id</code> or <code>key</code> is required.</p>
033     * @param id value to be set
034     * @return Builder
035     */
036
037    public CustomerGroupResourceIdentifierBuilder id(@Nullable final String id) {
038        this.id = id;
039        return this;
040    }
041
042    /**
043     *  <p>User-defined unique identifier of the referenced CustomerGroup. Either <code>id</code> or <code>key</code> is required.</p>
044     * @param key value to be set
045     * @return Builder
046     */
047
048    public CustomerGroupResourceIdentifierBuilder key(@Nullable final String key) {
049        this.key = key;
050        return this;
051    }
052
053    /**
054     *  <p>Unique identifier of the referenced CustomerGroup. Either <code>id</code> or <code>key</code> is required.</p>
055     * @return id
056     */
057
058    @Nullable
059    public String getId() {
060        return this.id;
061    }
062
063    /**
064     *  <p>User-defined unique identifier of the referenced CustomerGroup. Either <code>id</code> or <code>key</code> is required.</p>
065     * @return key
066     */
067
068    @Nullable
069    public String getKey() {
070        return this.key;
071    }
072
073    /**
074     * builds CustomerGroupResourceIdentifier with checking for non-null required values
075     * @return CustomerGroupResourceIdentifier
076     */
077    public CustomerGroupResourceIdentifier build() {
078        return new CustomerGroupResourceIdentifierImpl(id, key);
079    }
080
081    /**
082     * builds CustomerGroupResourceIdentifier without checking for non-null required values
083     * @return CustomerGroupResourceIdentifier
084     */
085    public CustomerGroupResourceIdentifier buildUnchecked() {
086        return new CustomerGroupResourceIdentifierImpl(id, key);
087    }
088
089    /**
090     * factory method for an instance of CustomerGroupResourceIdentifierBuilder
091     * @return builder
092     */
093    public static CustomerGroupResourceIdentifierBuilder of() {
094        return new CustomerGroupResourceIdentifierBuilder();
095    }
096
097    /**
098     * create builder for CustomerGroupResourceIdentifier instance
099     * @param template instance with prefilled values for the builder
100     * @return builder
101     */
102    public static CustomerGroupResourceIdentifierBuilder of(final CustomerGroupResourceIdentifier template) {
103        CustomerGroupResourceIdentifierBuilder builder = new CustomerGroupResourceIdentifierBuilder();
104        builder.id = template.getId();
105        builder.key = template.getKey();
106        return builder;
107    }
108
109}