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 * AttributeNameDoesNotExistErrorBuilder 011 * <hr> 012 * Example to create an instance using the builder pattern 013 * <div class=code-example> 014 * <pre><code class='java'> 015 * AttributeNameDoesNotExistError attributeNameDoesNotExistError = AttributeNameDoesNotExistError.builder() 016 * .message("{message}") 017 * .invalidAttributeName("{invalidAttributeName}") 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 AttributeNameDoesNotExistErrorBuilder implements Builder<AttributeNameDoesNotExistError> { 024 025 private String message; 026 027 private Map<String, java.lang.Object> values = new HashMap<>(); 028 029 private String invalidAttributeName; 030 031 /** 032 * <p><code>"Attribute definition for $attributeName does not exist on type $typeName."</code></p> 033 * @param message value to be set 034 * @return Builder 035 */ 036 037 public AttributeNameDoesNotExistErrorBuilder message(final String message) { 038 this.message = message; 039 return this; 040 } 041 042 /** 043 * <p>Error-specific additional fields.</p> 044 * @param values properties to be set 045 * @return Builder 046 */ 047 048 public AttributeNameDoesNotExistErrorBuilder values(final Map<String, java.lang.Object> values) { 049 this.values = values; 050 return this; 051 } 052 053 /** 054 * <p>Error-specific additional fields.</p> 055 * @param key property name 056 * @param value property value 057 * @return Builder 058 */ 059 060 public AttributeNameDoesNotExistErrorBuilder addValue(final String key, final java.lang.Object value) { 061 if (this.values == null) { 062 values = new HashMap<>(); 063 } 064 values.put(key, value); 065 return this; 066 } 067 068 /** 069 * <p>Non-existent Attribute name.</p> 070 * @param invalidAttributeName value to be set 071 * @return Builder 072 */ 073 074 public AttributeNameDoesNotExistErrorBuilder invalidAttributeName(final String invalidAttributeName) { 075 this.invalidAttributeName = invalidAttributeName; 076 return this; 077 } 078 079 /** 080 * <p><code>"Attribute definition for $attributeName does not exist on type $typeName."</code></p> 081 * @return message 082 */ 083 084 public String getMessage() { 085 return this.message; 086 } 087 088 /** 089 * <p>Error-specific additional fields.</p> 090 * @return pattern properties 091 */ 092 093 public Map<String, java.lang.Object> getValues() { 094 return this.values; 095 } 096 097 /** 098 * <p>Non-existent Attribute name.</p> 099 * @return invalidAttributeName 100 */ 101 102 public String getInvalidAttributeName() { 103 return this.invalidAttributeName; 104 } 105 106 /** 107 * builds AttributeNameDoesNotExistError with checking for non-null required values 108 * @return AttributeNameDoesNotExistError 109 */ 110 public AttributeNameDoesNotExistError build() { 111 Objects.requireNonNull(message, AttributeNameDoesNotExistError.class + ": message is missing"); 112 Objects.requireNonNull(invalidAttributeName, 113 AttributeNameDoesNotExistError.class + ": invalidAttributeName is missing"); 114 return new AttributeNameDoesNotExistErrorImpl(message, values, invalidAttributeName); 115 } 116 117 /** 118 * builds AttributeNameDoesNotExistError without checking for non-null required values 119 * @return AttributeNameDoesNotExistError 120 */ 121 public AttributeNameDoesNotExistError buildUnchecked() { 122 return new AttributeNameDoesNotExistErrorImpl(message, values, invalidAttributeName); 123 } 124 125 /** 126 * factory method for an instance of AttributeNameDoesNotExistErrorBuilder 127 * @return builder 128 */ 129 public static AttributeNameDoesNotExistErrorBuilder of() { 130 return new AttributeNameDoesNotExistErrorBuilder(); 131 } 132 133 /** 134 * create builder for AttributeNameDoesNotExistError instance 135 * @param template instance with prefilled values for the builder 136 * @return builder 137 */ 138 public static AttributeNameDoesNotExistErrorBuilder of(final AttributeNameDoesNotExistError template) { 139 AttributeNameDoesNotExistErrorBuilder builder = new AttributeNameDoesNotExistErrorBuilder(); 140 builder.message = template.getMessage(); 141 builder.values = template.values(); 142 builder.invalidAttributeName = template.getInvalidAttributeName(); 143 return builder; 144 } 145 146}