001
002package com.commercetools.api.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 id;
024
025    private java.util.List<com.commercetools.api.models.common.AssetSource> sources;
026
027    private com.commercetools.api.models.common.LocalizedString name;
028
029    private com.commercetools.api.models.common.LocalizedString description;
030
031    private java.util.List<String> tags;
032
033    private com.commercetools.api.models.type.CustomFields custom;
034
035    private String key;
036
037    /**
038     * create instance with all properties
039     */
040    @JsonCreator
041    AssetImpl(@JsonProperty("id") final String id,
042            @JsonProperty("sources") final java.util.List<com.commercetools.api.models.common.AssetSource> sources,
043            @JsonProperty("name") final com.commercetools.api.models.common.LocalizedString name,
044            @JsonProperty("description") final com.commercetools.api.models.common.LocalizedString description,
045            @JsonProperty("tags") final java.util.List<String> tags,
046            @JsonProperty("custom") final com.commercetools.api.models.type.CustomFields custom,
047            @JsonProperty("key") final String key) {
048        this.id = id;
049        this.sources = sources;
050        this.name = name;
051        this.description = description;
052        this.tags = tags;
053        this.custom = custom;
054        this.key = key;
055    }
056
057    /**
058     * create empty instance
059     */
060    public AssetImpl() {
061    }
062
063    /**
064     *  <p>Unique identifier of the Asset.</p>
065     */
066
067    public String getId() {
068        return this.id;
069    }
070
071    /**
072     *
073     */
074
075    public java.util.List<com.commercetools.api.models.common.AssetSource> getSources() {
076        return this.sources;
077    }
078
079    /**
080     *  <p>Name of the Asset.</p>
081     */
082
083    public com.commercetools.api.models.common.LocalizedString getName() {
084        return this.name;
085    }
086
087    /**
088     *  <p>Description of the Asset.</p>
089     */
090
091    public com.commercetools.api.models.common.LocalizedString getDescription() {
092        return this.description;
093    }
094
095    /**
096     *  <p>Keywords for categorizing and organizing Assets.</p>
097     */
098
099    public java.util.List<String> getTags() {
100        return this.tags;
101    }
102
103    /**
104     *  <p>Custom Fields defined for the Asset.</p>
105     */
106
107    public com.commercetools.api.models.type.CustomFields getCustom() {
108        return this.custom;
109    }
110
111    /**
112     *  <p>User-defined unique identifier of the Asset.</p>
113     */
114
115    public String getKey() {
116        return this.key;
117    }
118
119    public void setId(final String id) {
120        this.id = id;
121    }
122
123    public void setSources(final com.commercetools.api.models.common.AssetSource... sources) {
124        this.sources = new ArrayList<>(Arrays.asList(sources));
125    }
126
127    public void setSources(final java.util.List<com.commercetools.api.models.common.AssetSource> sources) {
128        this.sources = sources;
129    }
130
131    public void setName(final com.commercetools.api.models.common.LocalizedString name) {
132        this.name = name;
133    }
134
135    public void setDescription(final com.commercetools.api.models.common.LocalizedString description) {
136        this.description = description;
137    }
138
139    public void setTags(final String... tags) {
140        this.tags = new ArrayList<>(Arrays.asList(tags));
141    }
142
143    public void setTags(final java.util.List<String> tags) {
144        this.tags = tags;
145    }
146
147    public void setCustom(final com.commercetools.api.models.type.CustomFields custom) {
148        this.custom = custom;
149    }
150
151    public void setKey(final String key) {
152        this.key = key;
153    }
154
155    @Override
156    public boolean equals(Object o) {
157        if (this == o)
158            return true;
159
160        if (o == null || getClass() != o.getClass())
161            return false;
162
163        AssetImpl that = (AssetImpl) o;
164
165        return new EqualsBuilder().append(id, that.id)
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                .append(key, that.key)
172                .isEquals();
173    }
174
175    @Override
176    public int hashCode() {
177        return new HashCodeBuilder(17, 37).append(id)
178                .append(sources)
179                .append(name)
180                .append(description)
181                .append(tags)
182                .append(custom)
183                .append(key)
184                .toHashCode();
185    }
186
187}