001 002package com.commercetools.history.models.common; 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 * Transaction 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class TransactionImpl implements Transaction, ModelBase { 022 023 private String id; 024 025 private String timestamp; 026 027 private com.commercetools.history.models.common.TransactionType type; 028 029 private com.commercetools.history.models.common.Money amount; 030 031 private String interactionId; 032 033 private com.commercetools.history.models.common.TransactionState state; 034 035 /** 036 * create instance with all properties 037 */ 038 @JsonCreator 039 TransactionImpl(@JsonProperty("id") final String id, @JsonProperty("timestamp") final String timestamp, 040 @JsonProperty("type") final com.commercetools.history.models.common.TransactionType type, 041 @JsonProperty("amount") final com.commercetools.history.models.common.Money amount, 042 @JsonProperty("interactionId") final String interactionId, 043 @JsonProperty("state") final com.commercetools.history.models.common.TransactionState state) { 044 this.id = id; 045 this.timestamp = timestamp; 046 this.type = type; 047 this.amount = amount; 048 this.interactionId = interactionId; 049 this.state = state; 050 } 051 052 /** 053 * create empty instance 054 */ 055 public TransactionImpl() { 056 } 057 058 /** 059 * <p>Unique identifier of the Transaction.</p> 060 */ 061 062 public String getId() { 063 return this.id; 064 } 065 066 /** 067 * <p>Time at which the transaction took place.</p> 068 */ 069 070 public String getTimestamp() { 071 return this.timestamp; 072 } 073 074 /** 075 * 076 */ 077 078 public com.commercetools.history.models.common.TransactionType getType() { 079 return this.type; 080 } 081 082 /** 083 * 084 */ 085 086 public com.commercetools.history.models.common.Money getAmount() { 087 return this.amount; 088 } 089 090 /** 091 * <p>Identifier used by the interface that manages the transaction (usually the PSP). If a matching interaction was logged in the <code>interfaceInteractions</code> array, the corresponding interaction should be findable with this ID.</p> 092 */ 093 094 public String getInteractionId() { 095 return this.interactionId; 096 } 097 098 /** 099 * 100 */ 101 102 public com.commercetools.history.models.common.TransactionState getState() { 103 return this.state; 104 } 105 106 public void setId(final String id) { 107 this.id = id; 108 } 109 110 public void setTimestamp(final String timestamp) { 111 this.timestamp = timestamp; 112 } 113 114 public void setType(final com.commercetools.history.models.common.TransactionType type) { 115 this.type = type; 116 } 117 118 public void setAmount(final com.commercetools.history.models.common.Money amount) { 119 this.amount = amount; 120 } 121 122 public void setInteractionId(final String interactionId) { 123 this.interactionId = interactionId; 124 } 125 126 public void setState(final com.commercetools.history.models.common.TransactionState state) { 127 this.state = state; 128 } 129 130 @Override 131 public boolean equals(Object o) { 132 if (this == o) 133 return true; 134 135 if (o == null || getClass() != o.getClass()) 136 return false; 137 138 TransactionImpl that = (TransactionImpl) o; 139 140 return new EqualsBuilder().append(id, that.id) 141 .append(timestamp, that.timestamp) 142 .append(type, that.type) 143 .append(amount, that.amount) 144 .append(interactionId, that.interactionId) 145 .append(state, that.state) 146 .append(id, that.id) 147 .append(timestamp, that.timestamp) 148 .append(type, that.type) 149 .append(amount, that.amount) 150 .append(interactionId, that.interactionId) 151 .append(state, that.state) 152 .isEquals(); 153 } 154 155 @Override 156 public int hashCode() { 157 return new HashCodeBuilder(17, 37).append(id) 158 .append(timestamp) 159 .append(type) 160 .append(amount) 161 .append(interactionId) 162 .append(state) 163 .toHashCode(); 164 } 165 166}