001
002package com.commercetools.api.models.message;
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 *  <p>Generated after a successful Set Languages update action.</p>
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class StoreLanguagesChangedMessageImpl implements StoreLanguagesChangedMessage, ModelBase {
022
023    private String id;
024
025    private Long version;
026
027    private java.time.ZonedDateTime createdAt;
028
029    private java.time.ZonedDateTime lastModifiedAt;
030
031    private com.commercetools.api.models.common.LastModifiedBy lastModifiedBy;
032
033    private com.commercetools.api.models.common.CreatedBy createdBy;
034
035    private Long sequenceNumber;
036
037    private com.commercetools.api.models.common.Reference resource;
038
039    private Long resourceVersion;
040
041    private String type;
042
043    private com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers;
044
045    private java.util.List<String> addedLanguages;
046
047    private java.util.List<String> removedLanguages;
048
049    /**
050     * create instance with all properties
051     */
052    @JsonCreator
053    StoreLanguagesChangedMessageImpl(@JsonProperty("id") final String id, @JsonProperty("version") final Long version,
054            @JsonProperty("createdAt") final java.time.ZonedDateTime createdAt,
055            @JsonProperty("lastModifiedAt") final java.time.ZonedDateTime lastModifiedAt,
056            @JsonProperty("lastModifiedBy") final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy,
057            @JsonProperty("createdBy") final com.commercetools.api.models.common.CreatedBy createdBy,
058            @JsonProperty("sequenceNumber") final Long sequenceNumber,
059            @JsonProperty("resource") final com.commercetools.api.models.common.Reference resource,
060            @JsonProperty("resourceVersion") final Long resourceVersion,
061            @JsonProperty("resourceUserProvidedIdentifiers") final com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers,
062            @JsonProperty("addedLanguages") final java.util.List<String> addedLanguages,
063            @JsonProperty("removedLanguages") final java.util.List<String> removedLanguages) {
064        this.id = id;
065        this.version = version;
066        this.createdAt = createdAt;
067        this.lastModifiedAt = lastModifiedAt;
068        this.lastModifiedBy = lastModifiedBy;
069        this.createdBy = createdBy;
070        this.sequenceNumber = sequenceNumber;
071        this.resource = resource;
072        this.resourceVersion = resourceVersion;
073        this.resourceUserProvidedIdentifiers = resourceUserProvidedIdentifiers;
074        this.addedLanguages = addedLanguages;
075        this.removedLanguages = removedLanguages;
076        this.type = STORE_LANGUAGES_CHANGED;
077    }
078
079    /**
080     * create empty instance
081     */
082    public StoreLanguagesChangedMessageImpl() {
083        this.type = STORE_LANGUAGES_CHANGED;
084    }
085
086    /**
087     *  <p>Unique identifier of the Message. Can be used to track which Messages have been processed.</p>
088     */
089
090    public String getId() {
091        return this.id;
092    }
093
094    /**
095     *  <p>Version of a resource. In case of Messages, this is always <code>1</code>.</p>
096     */
097
098    public Long getVersion() {
099        return this.version;
100    }
101
102    /**
103     *  <p>Date and time (UTC) the Message was generated.</p>
104     */
105
106    public java.time.ZonedDateTime getCreatedAt() {
107        return this.createdAt;
108    }
109
110    /**
111     *  <p>Value of <code>createdAt</code>.</p>
112     */
113
114    public java.time.ZonedDateTime getLastModifiedAt() {
115        return this.lastModifiedAt;
116    }
117
118    /**
119     *  <p>Value of <code>createdBy</code>.</p>
120     */
121
122    public com.commercetools.api.models.common.LastModifiedBy getLastModifiedBy() {
123        return this.lastModifiedBy;
124    }
125
126    /**
127     *  <p>Present on resources created after 1 February 2019 except for events not tracked.</p>
128     */
129
130    public com.commercetools.api.models.common.CreatedBy getCreatedBy() {
131        return this.createdBy;
132    }
133
134    /**
135     *  <p>Message number in relation to other Messages for a given resource. The <code>sequenceNumber</code> of the next Message for the resource is the successor of the <code>sequenceNumber</code> of the current Message. Meaning, the <code>sequenceNumber</code> of the next Message equals the <code>sequenceNumber</code> of the current Message + 1. <code>sequenceNumber</code> can be used to ensure that Messages are processed in the correct order for a particular resource.</p>
136     */
137
138    public Long getSequenceNumber() {
139        return this.sequenceNumber;
140    }
141
142    /**
143     *  <p>Reference to the resource on which the change or action was performed.</p>
144     */
145
146    public com.commercetools.api.models.common.Reference getResource() {
147        return this.resource;
148    }
149
150    /**
151     *  <p>Version of the resource on which the change or action was performed.</p>
152     */
153
154    public Long getResourceVersion() {
155        return this.resourceVersion;
156    }
157
158    /**
159     *  <p>Message Type of the Message.</p>
160     */
161
162    public String getType() {
163        return this.type;
164    }
165
166    /**
167     *  <p>User-provided identifiers of the resource, such as <code>key</code> or <code>externalId</code>. Only present if the resource has such identifiers.</p>
168     */
169
170    public com.commercetools.api.models.message.UserProvidedIdentifiers getResourceUserProvidedIdentifiers() {
171        return this.resourceUserProvidedIdentifiers;
172    }
173
174    /**
175     *  <p>Locales added to the Store after the Set Languages update action.</p>
176     */
177
178    public java.util.List<String> getAddedLanguages() {
179        return this.addedLanguages;
180    }
181
182    /**
183     *  <p>Locales removed from the Store during the Set Languages update action.</p>
184     */
185
186    public java.util.List<String> getRemovedLanguages() {
187        return this.removedLanguages;
188    }
189
190    public void setId(final String id) {
191        this.id = id;
192    }
193
194    public void setVersion(final Long version) {
195        this.version = version;
196    }
197
198    public void setCreatedAt(final java.time.ZonedDateTime createdAt) {
199        this.createdAt = createdAt;
200    }
201
202    public void setLastModifiedAt(final java.time.ZonedDateTime lastModifiedAt) {
203        this.lastModifiedAt = lastModifiedAt;
204    }
205
206    public void setLastModifiedBy(final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy) {
207        this.lastModifiedBy = lastModifiedBy;
208    }
209
210    public void setCreatedBy(final com.commercetools.api.models.common.CreatedBy createdBy) {
211        this.createdBy = createdBy;
212    }
213
214    public void setSequenceNumber(final Long sequenceNumber) {
215        this.sequenceNumber = sequenceNumber;
216    }
217
218    public void setResource(final com.commercetools.api.models.common.Reference resource) {
219        this.resource = resource;
220    }
221
222    public void setResourceVersion(final Long resourceVersion) {
223        this.resourceVersion = resourceVersion;
224    }
225
226    public void setResourceUserProvidedIdentifiers(
227            final com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers) {
228        this.resourceUserProvidedIdentifiers = resourceUserProvidedIdentifiers;
229    }
230
231    public void setAddedLanguages(final String... addedLanguages) {
232        this.addedLanguages = new ArrayList<>(Arrays.asList(addedLanguages));
233    }
234
235    public void setAddedLanguages(final java.util.List<String> addedLanguages) {
236        this.addedLanguages = addedLanguages;
237    }
238
239    public void setRemovedLanguages(final String... removedLanguages) {
240        this.removedLanguages = new ArrayList<>(Arrays.asList(removedLanguages));
241    }
242
243    public void setRemovedLanguages(final java.util.List<String> removedLanguages) {
244        this.removedLanguages = removedLanguages;
245    }
246
247    @Override
248    public boolean equals(Object o) {
249        if (this == o)
250            return true;
251
252        if (o == null || getClass() != o.getClass())
253            return false;
254
255        StoreLanguagesChangedMessageImpl that = (StoreLanguagesChangedMessageImpl) o;
256
257        return new EqualsBuilder().append(id, that.id)
258                .append(version, that.version)
259                .append(createdAt, that.createdAt)
260                .append(lastModifiedAt, that.lastModifiedAt)
261                .append(lastModifiedBy, that.lastModifiedBy)
262                .append(createdBy, that.createdBy)
263                .append(sequenceNumber, that.sequenceNumber)
264                .append(resource, that.resource)
265                .append(resourceVersion, that.resourceVersion)
266                .append(type, that.type)
267                .append(resourceUserProvidedIdentifiers, that.resourceUserProvidedIdentifiers)
268                .append(addedLanguages, that.addedLanguages)
269                .append(removedLanguages, that.removedLanguages)
270                .append(id, that.id)
271                .append(version, that.version)
272                .append(createdAt, that.createdAt)
273                .append(lastModifiedAt, that.lastModifiedAt)
274                .append(lastModifiedBy, that.lastModifiedBy)
275                .append(createdBy, that.createdBy)
276                .append(sequenceNumber, that.sequenceNumber)
277                .append(resource, that.resource)
278                .append(resourceVersion, that.resourceVersion)
279                .append(type, that.type)
280                .append(resourceUserProvidedIdentifiers, that.resourceUserProvidedIdentifiers)
281                .append(addedLanguages, that.addedLanguages)
282                .append(removedLanguages, that.removedLanguages)
283                .isEquals();
284    }
285
286    @Override
287    public int hashCode() {
288        return new HashCodeBuilder(17, 37).append(id)
289                .append(version)
290                .append(createdAt)
291                .append(lastModifiedAt)
292                .append(lastModifiedBy)
293                .append(createdBy)
294                .append(sequenceNumber)
295                .append(resource)
296                .append(resourceVersion)
297                .append(type)
298                .append(resourceUserProvidedIdentifiers)
299                .append(addedLanguages)
300                .append(removedLanguages)
301                .toHashCode();
302    }
303
304}