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