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