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 Return Info update action on Orders and Order Edits.</p>
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class ReturnInfoSetMessageImpl implements ReturnInfoSetMessage, 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<com.commercetools.api.models.order.ReturnInfo> returnInfo;
046
047    /**
048     * create instance with all properties
049     */
050    @JsonCreator
051    ReturnInfoSetMessageImpl(@JsonProperty("id") final String id, @JsonProperty("version") final Long version,
052            @JsonProperty("createdAt") final java.time.ZonedDateTime createdAt,
053            @JsonProperty("lastModifiedAt") final java.time.ZonedDateTime lastModifiedAt,
054            @JsonProperty("lastModifiedBy") final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy,
055            @JsonProperty("createdBy") final com.commercetools.api.models.common.CreatedBy createdBy,
056            @JsonProperty("sequenceNumber") final Long sequenceNumber,
057            @JsonProperty("resource") final com.commercetools.api.models.common.Reference resource,
058            @JsonProperty("resourceVersion") final Long resourceVersion,
059            @JsonProperty("resourceUserProvidedIdentifiers") final com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers,
060            @JsonProperty("returnInfo") final java.util.List<com.commercetools.api.models.order.ReturnInfo> returnInfo) {
061        this.id = id;
062        this.version = version;
063        this.createdAt = createdAt;
064        this.lastModifiedAt = lastModifiedAt;
065        this.lastModifiedBy = lastModifiedBy;
066        this.createdBy = createdBy;
067        this.sequenceNumber = sequenceNumber;
068        this.resource = resource;
069        this.resourceVersion = resourceVersion;
070        this.resourceUserProvidedIdentifiers = resourceUserProvidedIdentifiers;
071        this.returnInfo = returnInfo;
072        this.type = RETURN_INFO_SET;
073    }
074
075    /**
076     * create empty instance
077     */
078    public ReturnInfoSetMessageImpl() {
079        this.type = RETURN_INFO_SET;
080    }
081
082    /**
083     *  <p>Unique identifier of the Message. Can be used to track which Messages have been processed.</p>
084     */
085
086    public String getId() {
087        return this.id;
088    }
089
090    /**
091     *  <p>Version of a resource. In case of Messages, this is always <code>1</code>.</p>
092     */
093
094    public Long getVersion() {
095        return this.version;
096    }
097
098    /**
099     *  <p>Date and time (UTC) the Message was generated.</p>
100     */
101
102    public java.time.ZonedDateTime getCreatedAt() {
103        return this.createdAt;
104    }
105
106    /**
107     *  <p>Value of <code>createdAt</code>.</p>
108     */
109
110    public java.time.ZonedDateTime getLastModifiedAt() {
111        return this.lastModifiedAt;
112    }
113
114    /**
115     *  <p>Value of <code>createdBy</code>.</p>
116     */
117
118    public com.commercetools.api.models.common.LastModifiedBy getLastModifiedBy() {
119        return this.lastModifiedBy;
120    }
121
122    /**
123     *  <p>Present on resources created after 1 February 2019 except for events not tracked.</p>
124     */
125
126    public com.commercetools.api.models.common.CreatedBy getCreatedBy() {
127        return this.createdBy;
128    }
129
130    /**
131     *  <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>
132     */
133
134    public Long getSequenceNumber() {
135        return this.sequenceNumber;
136    }
137
138    /**
139     *  <p>Reference to the resource on which the change or action was performed.</p>
140     */
141
142    public com.commercetools.api.models.common.Reference getResource() {
143        return this.resource;
144    }
145
146    /**
147     *  <p>Version of the resource on which the change or action was performed.</p>
148     */
149
150    public Long getResourceVersion() {
151        return this.resourceVersion;
152    }
153
154    /**
155     *  <p>Message Type of the Message.</p>
156     */
157
158    public String getType() {
159        return this.type;
160    }
161
162    /**
163     *  <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>
164     */
165
166    public com.commercetools.api.models.message.UserProvidedIdentifiers getResourceUserProvidedIdentifiers() {
167        return this.resourceUserProvidedIdentifiers;
168    }
169
170    /**
171     *  <p>The ReturnInfo that was set on the Order or Order Edit.</p>
172     */
173
174    public java.util.List<com.commercetools.api.models.order.ReturnInfo> getReturnInfo() {
175        return this.returnInfo;
176    }
177
178    public void setId(final String id) {
179        this.id = id;
180    }
181
182    public void setVersion(final Long version) {
183        this.version = version;
184    }
185
186    public void setCreatedAt(final java.time.ZonedDateTime createdAt) {
187        this.createdAt = createdAt;
188    }
189
190    public void setLastModifiedAt(final java.time.ZonedDateTime lastModifiedAt) {
191        this.lastModifiedAt = lastModifiedAt;
192    }
193
194    public void setLastModifiedBy(final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy) {
195        this.lastModifiedBy = lastModifiedBy;
196    }
197
198    public void setCreatedBy(final com.commercetools.api.models.common.CreatedBy createdBy) {
199        this.createdBy = createdBy;
200    }
201
202    public void setSequenceNumber(final Long sequenceNumber) {
203        this.sequenceNumber = sequenceNumber;
204    }
205
206    public void setResource(final com.commercetools.api.models.common.Reference resource) {
207        this.resource = resource;
208    }
209
210    public void setResourceVersion(final Long resourceVersion) {
211        this.resourceVersion = resourceVersion;
212    }
213
214    public void setResourceUserProvidedIdentifiers(
215            final com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers) {
216        this.resourceUserProvidedIdentifiers = resourceUserProvidedIdentifiers;
217    }
218
219    public void setReturnInfo(final com.commercetools.api.models.order.ReturnInfo... returnInfo) {
220        this.returnInfo = new ArrayList<>(Arrays.asList(returnInfo));
221    }
222
223    public void setReturnInfo(final java.util.List<com.commercetools.api.models.order.ReturnInfo> returnInfo) {
224        this.returnInfo = returnInfo;
225    }
226
227    @Override
228    public boolean equals(Object o) {
229        if (this == o)
230            return true;
231
232        if (o == null || getClass() != o.getClass())
233            return false;
234
235        ReturnInfoSetMessageImpl that = (ReturnInfoSetMessageImpl) o;
236
237        return new EqualsBuilder().append(id, that.id)
238                .append(version, that.version)
239                .append(createdAt, that.createdAt)
240                .append(lastModifiedAt, that.lastModifiedAt)
241                .append(lastModifiedBy, that.lastModifiedBy)
242                .append(createdBy, that.createdBy)
243                .append(sequenceNumber, that.sequenceNumber)
244                .append(resource, that.resource)
245                .append(resourceVersion, that.resourceVersion)
246                .append(type, that.type)
247                .append(resourceUserProvidedIdentifiers, that.resourceUserProvidedIdentifiers)
248                .append(returnInfo, that.returnInfo)
249                .isEquals();
250    }
251
252    @Override
253    public int hashCode() {
254        return new HashCodeBuilder(17, 37).append(id)
255                .append(version)
256                .append(createdAt)
257                .append(lastModifiedAt)
258                .append(lastModifiedBy)
259                .append(createdBy)
260                .append(sequenceNumber)
261                .append(resource)
262                .append(resourceVersion)
263                .append(type)
264                .append(resourceUserProvidedIdentifiers)
265                .append(returnInfo)
266                .toHashCode();
267    }
268
269}