001 002package com.commercetools.api.models.cart; 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 * CustomLineItemDraft 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class CustomLineItemDraftImpl implements CustomLineItemDraft, ModelBase { 022 023 private com.commercetools.api.models.common.LocalizedString name; 024 025 private String key; 026 027 private Long quantity; 028 029 private com.commercetools.api.models.common.Money money; 030 031 private String slug; 032 033 private com.commercetools.api.models.tax_category.TaxCategoryResourceIdentifier taxCategory; 034 035 private com.commercetools.api.models.cart.ExternalTaxRateDraft externalTaxRate; 036 037 private com.commercetools.api.models.type.CustomFieldsDraft custom; 038 039 private com.commercetools.api.models.cart.ItemShippingDetailsDraft shippingDetails; 040 041 private com.commercetools.api.models.cart.CustomLineItemPriceMode priceMode; 042 043 /** 044 * create instance with all properties 045 */ 046 @JsonCreator 047 CustomLineItemDraftImpl(@JsonProperty("name") final com.commercetools.api.models.common.LocalizedString name, 048 @JsonProperty("key") final String key, @JsonProperty("quantity") final Long quantity, 049 @JsonProperty("money") final com.commercetools.api.models.common.Money money, 050 @JsonProperty("slug") final String slug, 051 @JsonProperty("taxCategory") final com.commercetools.api.models.tax_category.TaxCategoryResourceIdentifier taxCategory, 052 @JsonProperty("externalTaxRate") final com.commercetools.api.models.cart.ExternalTaxRateDraft externalTaxRate, 053 @JsonProperty("custom") final com.commercetools.api.models.type.CustomFieldsDraft custom, 054 @JsonProperty("shippingDetails") final com.commercetools.api.models.cart.ItemShippingDetailsDraft shippingDetails, 055 @JsonProperty("priceMode") final com.commercetools.api.models.cart.CustomLineItemPriceMode priceMode) { 056 this.name = name; 057 this.key = key; 058 this.quantity = quantity; 059 this.money = money; 060 this.slug = slug; 061 this.taxCategory = taxCategory; 062 this.externalTaxRate = externalTaxRate; 063 this.custom = custom; 064 this.shippingDetails = shippingDetails; 065 this.priceMode = priceMode; 066 } 067 068 /** 069 * create empty instance 070 */ 071 public CustomLineItemDraftImpl() { 072 } 073 074 /** 075 * <p>Name of the Custom Line Item.</p> 076 */ 077 078 public com.commercetools.api.models.common.LocalizedString getName() { 079 return this.name; 080 } 081 082 /** 083 * <p>User-defined unique identifier of the Custom Line Item.</p> 084 */ 085 086 public String getKey() { 087 return this.key; 088 } 089 090 /** 091 * <p>Number of Custom Line Items to add to the Cart.</p> 092 */ 093 094 public Long getQuantity() { 095 return this.quantity; 096 } 097 098 /** 099 * <p>Money value of the Custom Line Item. The value can be negative.</p> 100 */ 101 102 public com.commercetools.api.models.common.Money getMoney() { 103 return this.money; 104 } 105 106 /** 107 * <p>User-defined identifier used in a deep-link URL for the Custom Line Item. It must match the pattern <code>[a-zA-Z0-9_-]{2,256}</code>.</p> 108 */ 109 110 public String getSlug() { 111 return this.slug; 112 } 113 114 /** 115 * <p>Used to select a Tax Rate when a Cart has the <code>Platform</code> TaxMode. This field is required for <code>Platform</code> TaxMode.</p> 116 */ 117 118 public com.commercetools.api.models.tax_category.TaxCategoryResourceIdentifier getTaxCategory() { 119 return this.taxCategory; 120 } 121 122 /** 123 * <p>External Tax Rate for the Custom Line Item if the Cart has the <code>External</code> TaxMode.</p> 124 */ 125 126 public com.commercetools.api.models.cart.ExternalTaxRateDraft getExternalTaxRate() { 127 return this.externalTaxRate; 128 } 129 130 /** 131 * <p>Custom Fields for the Custom Line Item.</p> 132 */ 133 134 public com.commercetools.api.models.type.CustomFieldsDraft getCustom() { 135 return this.custom; 136 } 137 138 /** 139 * <p>Container for Custom Line Item-specific addresses.</p> 140 */ 141 142 public com.commercetools.api.models.cart.ItemShippingDetailsDraft getShippingDetails() { 143 return this.shippingDetails; 144 } 145 146 /** 147 * <ul> 148 * <li>If <code>Standard</code>, Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.</li> 149 * <li>If <code>External</code>, Cart Discounts are not considered on the Custom Line Item.</li> 150 * </ul> 151 */ 152 153 public com.commercetools.api.models.cart.CustomLineItemPriceMode getPriceMode() { 154 return this.priceMode; 155 } 156 157 public void setName(final com.commercetools.api.models.common.LocalizedString name) { 158 this.name = name; 159 } 160 161 public void setKey(final String key) { 162 this.key = key; 163 } 164 165 public void setQuantity(final Long quantity) { 166 this.quantity = quantity; 167 } 168 169 public void setMoney(final com.commercetools.api.models.common.Money money) { 170 this.money = money; 171 } 172 173 public void setSlug(final String slug) { 174 this.slug = slug; 175 } 176 177 public void setTaxCategory( 178 final com.commercetools.api.models.tax_category.TaxCategoryResourceIdentifier taxCategory) { 179 this.taxCategory = taxCategory; 180 } 181 182 public void setExternalTaxRate(final com.commercetools.api.models.cart.ExternalTaxRateDraft externalTaxRate) { 183 this.externalTaxRate = externalTaxRate; 184 } 185 186 public void setCustom(final com.commercetools.api.models.type.CustomFieldsDraft custom) { 187 this.custom = custom; 188 } 189 190 public void setShippingDetails(final com.commercetools.api.models.cart.ItemShippingDetailsDraft shippingDetails) { 191 this.shippingDetails = shippingDetails; 192 } 193 194 public void setPriceMode(final com.commercetools.api.models.cart.CustomLineItemPriceMode priceMode) { 195 this.priceMode = priceMode; 196 } 197 198 @Override 199 public boolean equals(Object o) { 200 if (this == o) 201 return true; 202 203 if (o == null || getClass() != o.getClass()) 204 return false; 205 206 CustomLineItemDraftImpl that = (CustomLineItemDraftImpl) o; 207 208 return new EqualsBuilder().append(name, that.name) 209 .append(key, that.key) 210 .append(quantity, that.quantity) 211 .append(money, that.money) 212 .append(slug, that.slug) 213 .append(taxCategory, that.taxCategory) 214 .append(externalTaxRate, that.externalTaxRate) 215 .append(custom, that.custom) 216 .append(shippingDetails, that.shippingDetails) 217 .append(priceMode, that.priceMode) 218 .isEquals(); 219 } 220 221 @Override 222 public int hashCode() { 223 return new HashCodeBuilder(17, 37).append(name) 224 .append(key) 225 .append(quantity) 226 .append(money) 227 .append(slug) 228 .append(taxCategory) 229 .append(externalTaxRate) 230 .append(custom) 231 .append(shippingDetails) 232 .append(priceMode) 233 .toHashCode(); 234 } 235 236}