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 * GraphQLEnumKeyAlreadyExistsErrorBuilder 011 * <hr> 012 * Example to create an instance using the builder pattern 013 * <div class=code-example> 014 * <pre><code class='java'> 015 * GraphQLEnumKeyAlreadyExistsError graphQLEnumKeyAlreadyExistsError = GraphQLEnumKeyAlreadyExistsError.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 GraphQLEnumKeyAlreadyExistsErrorBuilder implements Builder<GraphQLEnumKeyAlreadyExistsError> { 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 GraphQLEnumKeyAlreadyExistsErrorBuilder 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 GraphQLEnumKeyAlreadyExistsErrorBuilder 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 GraphQLEnumKeyAlreadyExistsErrorBuilder 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 GraphQLEnumKeyAlreadyExistsErrorBuilder 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 GraphQLEnumKeyAlreadyExistsError with checking for non-null required values 108 * @return GraphQLEnumKeyAlreadyExistsError 109 */ 110 public GraphQLEnumKeyAlreadyExistsError build() { 111 Objects.requireNonNull(conflictingEnumKey, 112 GraphQLEnumKeyAlreadyExistsError.class + ": conflictingEnumKey is missing"); 113 Objects.requireNonNull(conflictingAttributeName, 114 GraphQLEnumKeyAlreadyExistsError.class + ": conflictingAttributeName is missing"); 115 return new GraphQLEnumKeyAlreadyExistsErrorImpl(values, conflictingEnumKey, conflictingAttributeName); 116 } 117 118 /** 119 * builds GraphQLEnumKeyAlreadyExistsError without checking for non-null required values 120 * @return GraphQLEnumKeyAlreadyExistsError 121 */ 122 public GraphQLEnumKeyAlreadyExistsError buildUnchecked() { 123 return new GraphQLEnumKeyAlreadyExistsErrorImpl(values, conflictingEnumKey, conflictingAttributeName); 124 } 125 126 /** 127 * factory method for an instance of GraphQLEnumKeyAlreadyExistsErrorBuilder 128 * @return builder 129 */ 130 public static GraphQLEnumKeyAlreadyExistsErrorBuilder of() { 131 return new GraphQLEnumKeyAlreadyExistsErrorBuilder(); 132 } 133 134 /** 135 * create builder for GraphQLEnumKeyAlreadyExistsError instance 136 * @param template instance with prefilled values for the builder 137 * @return builder 138 */ 139 public static GraphQLEnumKeyAlreadyExistsErrorBuilder of(final GraphQLEnumKeyAlreadyExistsError template) { 140 GraphQLEnumKeyAlreadyExistsErrorBuilder builder = new GraphQLEnumKeyAlreadyExistsErrorBuilder(); 141 builder.values = template.values(); 142 builder.conflictingEnumKey = template.getConflictingEnumKey(); 143 builder.conflictingAttributeName = template.getConflictingAttributeName(); 144 return builder; 145 } 146 147}