001 002package com.commercetools.api.models.category; 003 004import java.time.*; 005import java.util.*; 006 007import com.fasterxml.jackson.annotation.JsonCreator; 008import com.fasterxml.jackson.annotation.JsonProperty; 009import com.fasterxml.jackson.databind.annotation.*; 010 011import io.vrap.rmf.base.client.ModelBase; 012import io.vrap.rmf.base.client.utils.Generated; 013 014import org.apache.commons.lang3.builder.EqualsBuilder; 015import org.apache.commons.lang3.builder.HashCodeBuilder; 016 017/** 018 * CategoryDraft 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class CategoryDraftImpl implements CategoryDraft, ModelBase { 022 023 private com.commercetools.api.models.common.LocalizedString name; 024 025 private com.commercetools.api.models.common.LocalizedString slug; 026 027 private com.commercetools.api.models.common.LocalizedString description; 028 029 private com.commercetools.api.models.category.CategoryResourceIdentifier parent; 030 031 private String orderHint; 032 033 private String externalId; 034 035 private com.commercetools.api.models.common.LocalizedString metaTitle; 036 037 private com.commercetools.api.models.common.LocalizedString metaDescription; 038 039 private com.commercetools.api.models.common.LocalizedString metaKeywords; 040 041 private com.commercetools.api.models.type.CustomFieldsDraft custom; 042 043 private java.util.List<com.commercetools.api.models.common.AssetDraft> assets; 044 045 private String key; 046 047 /** 048 * create instance with all properties 049 */ 050 @JsonCreator 051 CategoryDraftImpl(@JsonProperty("name") final com.commercetools.api.models.common.LocalizedString name, 052 @JsonProperty("slug") final com.commercetools.api.models.common.LocalizedString slug, 053 @JsonProperty("description") final com.commercetools.api.models.common.LocalizedString description, 054 @JsonProperty("parent") final com.commercetools.api.models.category.CategoryResourceIdentifier parent, 055 @JsonProperty("orderHint") final String orderHint, @JsonProperty("externalId") final String externalId, 056 @JsonProperty("metaTitle") final com.commercetools.api.models.common.LocalizedString metaTitle, 057 @JsonProperty("metaDescription") final com.commercetools.api.models.common.LocalizedString metaDescription, 058 @JsonProperty("metaKeywords") final com.commercetools.api.models.common.LocalizedString metaKeywords, 059 @JsonProperty("custom") final com.commercetools.api.models.type.CustomFieldsDraft custom, 060 @JsonProperty("assets") final java.util.List<com.commercetools.api.models.common.AssetDraft> assets, 061 @JsonProperty("key") final String key) { 062 this.name = name; 063 this.slug = slug; 064 this.description = description; 065 this.parent = parent; 066 this.orderHint = orderHint; 067 this.externalId = externalId; 068 this.metaTitle = metaTitle; 069 this.metaDescription = metaDescription; 070 this.metaKeywords = metaKeywords; 071 this.custom = custom; 072 this.assets = assets; 073 this.key = key; 074 } 075 076 /** 077 * create empty instance 078 */ 079 public CategoryDraftImpl() { 080 } 081 082 /** 083 * <p>Name of the Category.</p> 084 */ 085 086 public com.commercetools.api.models.common.LocalizedString getName() { 087 return this.name; 088 } 089 090 /** 091 * <p>User-defined identifier used as a deep-link URL to the related Category. A Category can have the same slug for different Locales, but it must be unique across the Project. Valid slugs must match the pattern <code>^[A-Za-z0-9_-]{2,256}+$</code>.</p> 092 */ 093 094 public com.commercetools.api.models.common.LocalizedString getSlug() { 095 return this.slug; 096 } 097 098 /** 099 * <p>Description of the Category.</p> 100 */ 101 102 public com.commercetools.api.models.common.LocalizedString getDescription() { 103 return this.description; 104 } 105 106 /** 107 * <p>Parent Category of the Category. The parent can be set by its <code>id</code> or <code>key</code>.</p> 108 */ 109 110 public com.commercetools.api.models.category.CategoryResourceIdentifier getParent() { 111 return this.parent; 112 } 113 114 /** 115 * <p>Decimal value between 0 and 1 used to order Categories that are on the same level in the Category tree. If not set, a random value will be assigned.</p> 116 */ 117 118 public String getOrderHint() { 119 return this.orderHint; 120 } 121 122 /** 123 * <p>Additional identifier for external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).</p> 124 */ 125 126 public String getExternalId() { 127 return this.externalId; 128 } 129 130 /** 131 * <p>Name of the Category used by external search engines for improved search engine performance.</p> 132 */ 133 134 public com.commercetools.api.models.common.LocalizedString getMetaTitle() { 135 return this.metaTitle; 136 } 137 138 /** 139 * <p>Description of the Category used by external search engines for improved search engine performance.</p> 140 */ 141 142 public com.commercetools.api.models.common.LocalizedString getMetaDescription() { 143 return this.metaDescription; 144 } 145 146 /** 147 * <p>Keywords related to the Category for improved search engine performance.</p> 148 */ 149 150 public com.commercetools.api.models.common.LocalizedString getMetaKeywords() { 151 return this.metaKeywords; 152 } 153 154 /** 155 * <p>Custom Fields for the Category.</p> 156 */ 157 158 public com.commercetools.api.models.type.CustomFieldsDraft getCustom() { 159 return this.custom; 160 } 161 162 /** 163 * <p>Media related to the Category.</p> 164 */ 165 166 public java.util.List<com.commercetools.api.models.common.AssetDraft> getAssets() { 167 return this.assets; 168 } 169 170 /** 171 * <p>User-defined unique identifier for the Category.</p> 172 */ 173 174 public String getKey() { 175 return this.key; 176 } 177 178 public void setName(final com.commercetools.api.models.common.LocalizedString name) { 179 this.name = name; 180 } 181 182 public void setSlug(final com.commercetools.api.models.common.LocalizedString slug) { 183 this.slug = slug; 184 } 185 186 public void setDescription(final com.commercetools.api.models.common.LocalizedString description) { 187 this.description = description; 188 } 189 190 public void setParent(final com.commercetools.api.models.category.CategoryResourceIdentifier parent) { 191 this.parent = parent; 192 } 193 194 public void setOrderHint(final String orderHint) { 195 this.orderHint = orderHint; 196 } 197 198 public void setExternalId(final String externalId) { 199 this.externalId = externalId; 200 } 201 202 public void setMetaTitle(final com.commercetools.api.models.common.LocalizedString metaTitle) { 203 this.metaTitle = metaTitle; 204 } 205 206 public void setMetaDescription(final com.commercetools.api.models.common.LocalizedString metaDescription) { 207 this.metaDescription = metaDescription; 208 } 209 210 public void setMetaKeywords(final com.commercetools.api.models.common.LocalizedString metaKeywords) { 211 this.metaKeywords = metaKeywords; 212 } 213 214 public void setCustom(final com.commercetools.api.models.type.CustomFieldsDraft custom) { 215 this.custom = custom; 216 } 217 218 public void setAssets(final com.commercetools.api.models.common.AssetDraft... assets) { 219 this.assets = new ArrayList<>(Arrays.asList(assets)); 220 } 221 222 public void setAssets(final java.util.List<com.commercetools.api.models.common.AssetDraft> assets) { 223 this.assets = assets; 224 } 225 226 public void setKey(final String key) { 227 this.key = key; 228 } 229 230 @Override 231 public boolean equals(Object o) { 232 if (this == o) 233 return true; 234 235 if (o == null || getClass() != o.getClass()) 236 return false; 237 238 CategoryDraftImpl that = (CategoryDraftImpl) o; 239 240 return new EqualsBuilder().append(name, that.name) 241 .append(slug, that.slug) 242 .append(description, that.description) 243 .append(parent, that.parent) 244 .append(orderHint, that.orderHint) 245 .append(externalId, that.externalId) 246 .append(metaTitle, that.metaTitle) 247 .append(metaDescription, that.metaDescription) 248 .append(metaKeywords, that.metaKeywords) 249 .append(custom, that.custom) 250 .append(assets, that.assets) 251 .append(key, that.key) 252 .isEquals(); 253 } 254 255 @Override 256 public int hashCode() { 257 return new HashCodeBuilder(17, 37).append(name) 258 .append(slug) 259 .append(description) 260 .append(parent) 261 .append(orderHint) 262 .append(externalId) 263 .append(metaTitle) 264 .append(metaDescription) 265 .append(metaKeywords) 266 .append(custom) 267 .append(assets) 268 .append(key) 269 .toHashCode(); 270 } 271 272}