001 002package com.commercetools.api.models.order; 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 * OrderFromQuoteDraft 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class OrderFromQuoteDraftImpl implements OrderFromQuoteDraft, ModelBase { 022 023 private com.commercetools.api.models.quote.QuoteResourceIdentifier quote; 024 025 private Long version; 026 027 private Boolean quoteStateToAccepted; 028 029 private String orderNumber; 030 031 private com.commercetools.api.models.order.PaymentState paymentState; 032 033 private com.commercetools.api.models.order.ShipmentState shipmentState; 034 035 private com.commercetools.api.models.order.OrderState orderState; 036 037 private com.commercetools.api.models.state.StateResourceIdentifier state; 038 039 /** 040 * create instance with all properties 041 */ 042 @JsonCreator 043 OrderFromQuoteDraftImpl( 044 @JsonProperty("quote") final com.commercetools.api.models.quote.QuoteResourceIdentifier quote, 045 @JsonProperty("version") final Long version, 046 @JsonProperty("quoteStateToAccepted") final Boolean quoteStateToAccepted, 047 @JsonProperty("orderNumber") final String orderNumber, 048 @JsonProperty("paymentState") final com.commercetools.api.models.order.PaymentState paymentState, 049 @JsonProperty("shipmentState") final com.commercetools.api.models.order.ShipmentState shipmentState, 050 @JsonProperty("orderState") final com.commercetools.api.models.order.OrderState orderState, 051 @JsonProperty("state") final com.commercetools.api.models.state.StateResourceIdentifier state) { 052 this.quote = quote; 053 this.version = version; 054 this.quoteStateToAccepted = quoteStateToAccepted; 055 this.orderNumber = orderNumber; 056 this.paymentState = paymentState; 057 this.shipmentState = shipmentState; 058 this.orderState = orderState; 059 this.state = state; 060 } 061 062 /** 063 * create empty instance 064 */ 065 public OrderFromQuoteDraftImpl() { 066 } 067 068 /** 069 * <p>ResourceIdentifier to the Quote from which the Order is created. If the referenced Quote has expired (<code>validTo</code> check) or its <code>quoteState</code> is <code>Accepted</code>, <code>Declined</code>, or <code>Withdrawn</code>, the Order creation will fail.</p> 070 */ 071 072 public com.commercetools.api.models.quote.QuoteResourceIdentifier getQuote() { 073 return this.quote; 074 } 075 076 /** 077 * <p><code>version</code> of the Quote from which the Order is created.</p> 078 */ 079 080 public Long getVersion() { 081 return this.version; 082 } 083 084 /** 085 * <p>If <code>true</code>, the <code>quoteState</code> of the referenced Quote will be set to <code>Accepted</code>.</p> 086 */ 087 088 public Boolean getQuoteStateToAccepted() { 089 return this.quoteStateToAccepted; 090 } 091 092 /** 093 * <p>User-defined identifier for the Order that is unique across a Project. Once set, the value cannot be changed.</p> 094 */ 095 096 public String getOrderNumber() { 097 return this.orderNumber; 098 } 099 100 /** 101 * <p>Payment status for the Order.</p> 102 */ 103 104 public com.commercetools.api.models.order.PaymentState getPaymentState() { 105 return this.paymentState; 106 } 107 108 /** 109 * <p>Shipment status for the Order.</p> 110 */ 111 112 public com.commercetools.api.models.order.ShipmentState getShipmentState() { 113 return this.shipmentState; 114 } 115 116 /** 117 * <p>Current status for the Order.</p> 118 */ 119 120 public com.commercetools.api.models.order.OrderState getOrderState() { 121 return this.orderState; 122 } 123 124 /** 125 * <p>State of the Order in a custom workflow.</p> 126 */ 127 128 public com.commercetools.api.models.state.StateResourceIdentifier getState() { 129 return this.state; 130 } 131 132 public void setQuote(final com.commercetools.api.models.quote.QuoteResourceIdentifier quote) { 133 this.quote = quote; 134 } 135 136 public void setVersion(final Long version) { 137 this.version = version; 138 } 139 140 public void setQuoteStateToAccepted(final Boolean quoteStateToAccepted) { 141 this.quoteStateToAccepted = quoteStateToAccepted; 142 } 143 144 public void setOrderNumber(final String orderNumber) { 145 this.orderNumber = orderNumber; 146 } 147 148 public void setPaymentState(final com.commercetools.api.models.order.PaymentState paymentState) { 149 this.paymentState = paymentState; 150 } 151 152 public void setShipmentState(final com.commercetools.api.models.order.ShipmentState shipmentState) { 153 this.shipmentState = shipmentState; 154 } 155 156 public void setOrderState(final com.commercetools.api.models.order.OrderState orderState) { 157 this.orderState = orderState; 158 } 159 160 public void setState(final com.commercetools.api.models.state.StateResourceIdentifier state) { 161 this.state = state; 162 } 163 164 @Override 165 public boolean equals(Object o) { 166 if (this == o) 167 return true; 168 169 if (o == null || getClass() != o.getClass()) 170 return false; 171 172 OrderFromQuoteDraftImpl that = (OrderFromQuoteDraftImpl) o; 173 174 return new EqualsBuilder().append(quote, that.quote) 175 .append(version, that.version) 176 .append(quoteStateToAccepted, that.quoteStateToAccepted) 177 .append(orderNumber, that.orderNumber) 178 .append(paymentState, that.paymentState) 179 .append(shipmentState, that.shipmentState) 180 .append(orderState, that.orderState) 181 .append(state, that.state) 182 .append(quote, that.quote) 183 .append(version, that.version) 184 .append(quoteStateToAccepted, that.quoteStateToAccepted) 185 .append(orderNumber, that.orderNumber) 186 .append(paymentState, that.paymentState) 187 .append(shipmentState, that.shipmentState) 188 .append(orderState, that.orderState) 189 .append(state, that.state) 190 .isEquals(); 191 } 192 193 @Override 194 public int hashCode() { 195 return new HashCodeBuilder(17, 37).append(quote) 196 .append(version) 197 .append(quoteStateToAccepted) 198 .append(orderNumber) 199 .append(paymentState) 200 .append(shipmentState) 201 .append(orderState) 202 .append(state) 203 .toHashCode(); 204 } 205 206}