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