001 002package com.commercetools.importapi.models.common; 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 * Asset 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class AssetImpl implements Asset, ModelBase { 022 023 private String key; 024 025 private java.util.List<com.commercetools.importapi.models.common.AssetSource> sources; 026 027 private com.commercetools.importapi.models.common.LocalizedString name; 028 029 private com.commercetools.importapi.models.common.LocalizedString description; 030 031 private java.util.List<String> tags; 032 033 private com.commercetools.importapi.models.customfields.Custom custom; 034 035 /** 036 * create instance with all properties 037 */ 038 @JsonCreator 039 AssetImpl(@JsonProperty("key") final String key, 040 @JsonProperty("sources") final java.util.List<com.commercetools.importapi.models.common.AssetSource> sources, 041 @JsonProperty("name") final com.commercetools.importapi.models.common.LocalizedString name, 042 @JsonProperty("description") final com.commercetools.importapi.models.common.LocalizedString description, 043 @JsonProperty("tags") final java.util.List<String> tags, 044 @JsonProperty("custom") final com.commercetools.importapi.models.customfields.Custom custom) { 045 this.key = key; 046 this.sources = sources; 047 this.name = name; 048 this.description = description; 049 this.tags = tags; 050 this.custom = custom; 051 } 052 053 /** 054 * create empty instance 055 */ 056 public AssetImpl() { 057 } 058 059 /** 060 * <p>User-defined identifier for the asset. Asset keys are unique inside their container (a product variant or a category).</p> 061 */ 062 063 public String getKey() { 064 return this.key; 065 } 066 067 /** 068 * 069 */ 070 071 public java.util.List<com.commercetools.importapi.models.common.AssetSource> getSources() { 072 return this.sources; 073 } 074 075 /** 076 * <p>A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.</p> 077 * <pre><code>{ 078 * "de": "Hundefutter", 079 * "en": "dog food" 080 * } 081 * </code></pre> 082 */ 083 084 public com.commercetools.importapi.models.common.LocalizedString getName() { 085 return this.name; 086 } 087 088 /** 089 * <p>A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.</p> 090 * <pre><code>{ 091 * "de": "Hundefutter", 092 * "en": "dog food" 093 * } 094 * </code></pre> 095 */ 096 097 public com.commercetools.importapi.models.common.LocalizedString getDescription() { 098 return this.description; 099 } 100 101 /** 102 * 103 */ 104 105 public java.util.List<String> getTags() { 106 return this.tags; 107 } 108 109 /** 110 * <p>The representation to be sent to the server when creating a resource with custom fields.</p> 111 */ 112 113 public com.commercetools.importapi.models.customfields.Custom getCustom() { 114 return this.custom; 115 } 116 117 public void setKey(final String key) { 118 this.key = key; 119 } 120 121 public void setSources(final com.commercetools.importapi.models.common.AssetSource... sources) { 122 this.sources = new ArrayList<>(Arrays.asList(sources)); 123 } 124 125 public void setSources(final java.util.List<com.commercetools.importapi.models.common.AssetSource> sources) { 126 this.sources = sources; 127 } 128 129 public void setName(final com.commercetools.importapi.models.common.LocalizedString name) { 130 this.name = name; 131 } 132 133 public void setDescription(final com.commercetools.importapi.models.common.LocalizedString description) { 134 this.description = description; 135 } 136 137 public void setTags(final String... tags) { 138 this.tags = new ArrayList<>(Arrays.asList(tags)); 139 } 140 141 public void setTags(final java.util.List<String> tags) { 142 this.tags = tags; 143 } 144 145 public void setCustom(final com.commercetools.importapi.models.customfields.Custom custom) { 146 this.custom = custom; 147 } 148 149 @Override 150 public boolean equals(Object o) { 151 if (this == o) 152 return true; 153 154 if (o == null || getClass() != o.getClass()) 155 return false; 156 157 AssetImpl that = (AssetImpl) o; 158 159 return new EqualsBuilder().append(key, that.key) 160 .append(sources, that.sources) 161 .append(name, that.name) 162 .append(description, that.description) 163 .append(tags, that.tags) 164 .append(custom, that.custom) 165 .append(key, that.key) 166 .append(sources, that.sources) 167 .append(name, that.name) 168 .append(description, that.description) 169 .append(tags, that.tags) 170 .append(custom, that.custom) 171 .isEquals(); 172 } 173 174 @Override 175 public int hashCode() { 176 return new HashCodeBuilder(17, 37).append(key) 177 .append(sources) 178 .append(name) 179 .append(description) 180 .append(tags) 181 .append(custom) 182 .toHashCode(); 183 } 184 185}