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