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