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 * CustomLineItem
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class CustomLineItemImpl implements CustomLineItem, ModelBase {
022
023    private String id;
024
025    private com.commercetools.history.models.common.LocalizedString name;
026
027    private com.commercetools.history.models.common.Money money;
028
029    private com.commercetools.history.models.common.TaxedItemPrice taxedPrice;
030
031    private com.commercetools.history.models.common.Money totalPrice;
032
033    private String slug;
034
035    private Integer quantity;
036
037    /**
038     * create instance with all properties
039     */
040    @JsonCreator
041    CustomLineItemImpl(@JsonProperty("id") final String id,
042            @JsonProperty("name") final com.commercetools.history.models.common.LocalizedString name,
043            @JsonProperty("money") final com.commercetools.history.models.common.Money money,
044            @JsonProperty("taxedPrice") final com.commercetools.history.models.common.TaxedItemPrice taxedPrice,
045            @JsonProperty("totalPrice") final com.commercetools.history.models.common.Money totalPrice,
046            @JsonProperty("slug") final String slug, @JsonProperty("quantity") final Integer quantity) {
047        this.id = id;
048        this.name = name;
049        this.money = money;
050        this.taxedPrice = taxedPrice;
051        this.totalPrice = totalPrice;
052        this.slug = slug;
053        this.quantity = quantity;
054    }
055
056    /**
057     * create empty instance
058     */
059    public CustomLineItemImpl() {
060    }
061
062    /**
063     *  <p>The unique ID of this CustomLineItem.</p>
064     */
065
066    public String getId() {
067        return this.id;
068    }
069
070    /**
071     *
072     */
073
074    public com.commercetools.history.models.common.LocalizedString getName() {
075        return this.name;
076    }
077
078    /**
079     *
080     */
081
082    public com.commercetools.history.models.common.Money getMoney() {
083        return this.money;
084    }
085
086    /**
087     *
088     */
089
090    public com.commercetools.history.models.common.TaxedItemPrice getTaxedPrice() {
091        return this.taxedPrice;
092    }
093
094    /**
095     *
096     */
097
098    public com.commercetools.history.models.common.Money getTotalPrice() {
099        return this.totalPrice;
100    }
101
102    /**
103     *  <p>A unique String in the cart to identify this CustomLineItem.</p>
104     */
105
106    public String getSlug() {
107        return this.slug;
108    }
109
110    /**
111     *  <p>The amount of a CustomLineItem in the cart. Must be a positive integer.</p>
112     */
113
114    public Integer getQuantity() {
115        return this.quantity;
116    }
117
118    public void setId(final String id) {
119        this.id = id;
120    }
121
122    public void setName(final com.commercetools.history.models.common.LocalizedString name) {
123        this.name = name;
124    }
125
126    public void setMoney(final com.commercetools.history.models.common.Money money) {
127        this.money = money;
128    }
129
130    public void setTaxedPrice(final com.commercetools.history.models.common.TaxedItemPrice taxedPrice) {
131        this.taxedPrice = taxedPrice;
132    }
133
134    public void setTotalPrice(final com.commercetools.history.models.common.Money totalPrice) {
135        this.totalPrice = totalPrice;
136    }
137
138    public void setSlug(final String slug) {
139        this.slug = slug;
140    }
141
142    public void setQuantity(final Integer quantity) {
143        this.quantity = quantity;
144    }
145
146    @Override
147    public boolean equals(Object o) {
148        if (this == o)
149            return true;
150
151        if (o == null || getClass() != o.getClass())
152            return false;
153
154        CustomLineItemImpl that = (CustomLineItemImpl) o;
155
156        return new EqualsBuilder().append(id, that.id)
157                .append(name, that.name)
158                .append(money, that.money)
159                .append(taxedPrice, that.taxedPrice)
160                .append(totalPrice, that.totalPrice)
161                .append(slug, that.slug)
162                .append(quantity, that.quantity)
163                .append(id, that.id)
164                .append(name, that.name)
165                .append(money, that.money)
166                .append(taxedPrice, that.taxedPrice)
167                .append(totalPrice, that.totalPrice)
168                .append(slug, that.slug)
169                .append(quantity, that.quantity)
170                .isEquals();
171    }
172
173    @Override
174    public int hashCode() {
175        return new HashCodeBuilder(17, 37).append(id)
176                .append(name)
177                .append(money)
178                .append(taxedPrice)
179                .append(totalPrice)
180                .append(slug)
181                .append(quantity)
182                .toHashCode();
183    }
184
185}