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 Change Customer update action.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class QuoteCustomerChangedMessageImpl implements QuoteCustomerChangedMessage, 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.customer.CustomerReference customer; 046 047 private com.commercetools.api.models.customer.CustomerReference previousCustomer; 048 049 /** 050 * create instance with all properties 051 */ 052 @JsonCreator 053 QuoteCustomerChangedMessageImpl(@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("customer") final com.commercetools.api.models.customer.CustomerReference customer, 063 @JsonProperty("previousCustomer") final com.commercetools.api.models.customer.CustomerReference previousCustomer) { 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.customer = customer; 075 this.previousCustomer = previousCustomer; 076 this.type = QUOTE_CUSTOMER_CHANGED; 077 } 078 079 /** 080 * create empty instance 081 */ 082 public QuoteCustomerChangedMessageImpl() { 083 this.type = QUOTE_CUSTOMER_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>The Buyer who now owns the Quote.</p> 176 */ 177 178 public com.commercetools.api.models.customer.CustomerReference getCustomer() { 179 return this.customer; 180 } 181 182 /** 183 * <p>The previous Buyer.</p> 184 */ 185 186 public com.commercetools.api.models.customer.CustomerReference getPreviousCustomer() { 187 return this.previousCustomer; 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 setCustomer(final com.commercetools.api.models.customer.CustomerReference customer) { 232 this.customer = customer; 233 } 234 235 public void setPreviousCustomer(final com.commercetools.api.models.customer.CustomerReference previousCustomer) { 236 this.previousCustomer = previousCustomer; 237 } 238 239 @Override 240 public boolean equals(Object o) { 241 if (this == o) 242 return true; 243 244 if (o == null || getClass() != o.getClass()) 245 return false; 246 247 QuoteCustomerChangedMessageImpl that = (QuoteCustomerChangedMessageImpl) o; 248 249 return new EqualsBuilder().append(id, that.id) 250 .append(version, that.version) 251 .append(createdAt, that.createdAt) 252 .append(lastModifiedAt, that.lastModifiedAt) 253 .append(lastModifiedBy, that.lastModifiedBy) 254 .append(createdBy, that.createdBy) 255 .append(sequenceNumber, that.sequenceNumber) 256 .append(resource, that.resource) 257 .append(resourceVersion, that.resourceVersion) 258 .append(type, that.type) 259 .append(resourceUserProvidedIdentifiers, that.resourceUserProvidedIdentifiers) 260 .append(customer, that.customer) 261 .append(previousCustomer, that.previousCustomer) 262 .isEquals(); 263 } 264 265 @Override 266 public int hashCode() { 267 return new HashCodeBuilder(17, 37).append(id) 268 .append(version) 269 .append(createdAt) 270 .append(lastModifiedAt) 271 .append(lastModifiedBy) 272 .append(createdBy) 273 .append(sequenceNumber) 274 .append(resource) 275 .append(resourceVersion) 276 .append(type) 277 .append(resourceUserProvidedIdentifiers) 278 .append(customer) 279 .append(previousCustomer) 280 .toHashCode(); 281 } 282 283}