001
002package com.commercetools.api.models.error;
003
004import java.util.*;
005
006import io.vrap.rmf.base.client.Builder;
007import io.vrap.rmf.base.client.utils.Generated;
008
009/**
010 * GraphQLEnumKeyDoesNotExistErrorBuilder
011 * <hr>
012 * Example to create an instance using the builder pattern
013 * <div class=code-example>
014 * <pre><code class='java'>
015 *     GraphQLEnumKeyDoesNotExistError graphQLEnumKeyDoesNotExistError = GraphQLEnumKeyDoesNotExistError.builder()
016 *             .conflictingEnumKey("{conflictingEnumKey}")
017 *             .conflictingAttributeName("{conflictingAttributeName}")
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 GraphQLEnumKeyDoesNotExistErrorBuilder implements Builder<GraphQLEnumKeyDoesNotExistError> {
024
025    private Map<String, java.lang.Object> values = new HashMap<>();
026
027    private String conflictingEnumKey;
028
029    private String conflictingAttributeName;
030
031    /**
032     *  <p>Error-specific additional fields.</p>
033     * @param values properties to be set
034     * @return Builder
035     */
036
037    public GraphQLEnumKeyDoesNotExistErrorBuilder values(final Map<String, java.lang.Object> values) {
038        this.values = values;
039        return this;
040    }
041
042    /**
043     *  <p>Error-specific additional fields.</p>
044     * @param key property name
045     * @param value property value
046     * @return Builder
047     */
048
049    public GraphQLEnumKeyDoesNotExistErrorBuilder addValue(final String key, final java.lang.Object value) {
050        if (this.values == null) {
051            values = new HashMap<>();
052        }
053        values.put(key, value);
054        return this;
055    }
056
057    /**
058     *  <p>Conflicting enum key.</p>
059     * @param conflictingEnumKey value to be set
060     * @return Builder
061     */
062
063    public GraphQLEnumKeyDoesNotExistErrorBuilder conflictingEnumKey(final String conflictingEnumKey) {
064        this.conflictingEnumKey = conflictingEnumKey;
065        return this;
066    }
067
068    /**
069     *  <p>Name of the conflicting Attribute.</p>
070     * @param conflictingAttributeName value to be set
071     * @return Builder
072     */
073
074    public GraphQLEnumKeyDoesNotExistErrorBuilder conflictingAttributeName(final String conflictingAttributeName) {
075        this.conflictingAttributeName = conflictingAttributeName;
076        return this;
077    }
078
079    /**
080     *  <p>Error-specific additional fields.</p>
081     * @return pattern properties
082     */
083
084    public Map<String, java.lang.Object> getValues() {
085        return this.values;
086    }
087
088    /**
089     *  <p>Conflicting enum key.</p>
090     * @return conflictingEnumKey
091     */
092
093    public String getConflictingEnumKey() {
094        return this.conflictingEnumKey;
095    }
096
097    /**
098     *  <p>Name of the conflicting Attribute.</p>
099     * @return conflictingAttributeName
100     */
101
102    public String getConflictingAttributeName() {
103        return this.conflictingAttributeName;
104    }
105
106    /**
107     * builds GraphQLEnumKeyDoesNotExistError with checking for non-null required values
108     * @return GraphQLEnumKeyDoesNotExistError
109     */
110    public GraphQLEnumKeyDoesNotExistError build() {
111        Objects.requireNonNull(conflictingEnumKey,
112            GraphQLEnumKeyDoesNotExistError.class + ": conflictingEnumKey is missing");
113        Objects.requireNonNull(conflictingAttributeName,
114            GraphQLEnumKeyDoesNotExistError.class + ": conflictingAttributeName is missing");
115        return new GraphQLEnumKeyDoesNotExistErrorImpl(values, conflictingEnumKey, conflictingAttributeName);
116    }
117
118    /**
119     * builds GraphQLEnumKeyDoesNotExistError without checking for non-null required values
120     * @return GraphQLEnumKeyDoesNotExistError
121     */
122    public GraphQLEnumKeyDoesNotExistError buildUnchecked() {
123        return new GraphQLEnumKeyDoesNotExistErrorImpl(values, conflictingEnumKey, conflictingAttributeName);
124    }
125
126    /**
127     * factory method for an instance of GraphQLEnumKeyDoesNotExistErrorBuilder
128     * @return builder
129     */
130    public static GraphQLEnumKeyDoesNotExistErrorBuilder of() {
131        return new GraphQLEnumKeyDoesNotExistErrorBuilder();
132    }
133
134    /**
135     * create builder for GraphQLEnumKeyDoesNotExistError instance
136     * @param template instance with prefilled values for the builder
137     * @return builder
138     */
139    public static GraphQLEnumKeyDoesNotExistErrorBuilder of(final GraphQLEnumKeyDoesNotExistError template) {
140        GraphQLEnumKeyDoesNotExistErrorBuilder builder = new GraphQLEnumKeyDoesNotExistErrorBuilder();
141        builder.values = template.values();
142        builder.conflictingEnumKey = template.getConflictingEnumKey();
143        builder.conflictingAttributeName = template.getConflictingAttributeName();
144        return builder;
145    }
146
147}