001
002package com.commercetools.api.models.me;
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 * MyShoppingListRemoveTextLineItemAction
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class MyShoppingListRemoveTextLineItemActionImpl implements MyShoppingListRemoveTextLineItemAction, ModelBase {
022
023    private String action;
024
025    private String textLineItemId;
026
027    private String textLineItemKey;
028
029    private Long quantity;
030
031    /**
032     * create instance with all properties
033     */
034    @JsonCreator
035    MyShoppingListRemoveTextLineItemActionImpl(@JsonProperty("textLineItemId") final String textLineItemId,
036            @JsonProperty("textLineItemKey") final String textLineItemKey,
037            @JsonProperty("quantity") final Long quantity) {
038        this.textLineItemId = textLineItemId;
039        this.textLineItemKey = textLineItemKey;
040        this.quantity = quantity;
041        this.action = REMOVE_TEXT_LINE_ITEM;
042    }
043
044    /**
045     * create empty instance
046     */
047    public MyShoppingListRemoveTextLineItemActionImpl() {
048        this.action = REMOVE_TEXT_LINE_ITEM;
049    }
050
051    /**
052     *
053     */
054
055    public String getAction() {
056        return this.action;
057    }
058
059    /**
060     *  <p>The <code>id</code> of the TextLineItem to update. Either <code>lineItemId</code> or <code>lineItemKey</code> is required.</p>
061     */
062
063    public String getTextLineItemId() {
064        return this.textLineItemId;
065    }
066
067    /**
068     *  <p>The <code>key</code> of the TextLineItem to update. Either <code>lineItemId</code> or <code>lineItemKey</code> is required.</p>
069     */
070
071    public String getTextLineItemKey() {
072        return this.textLineItemKey;
073    }
074
075    /**
076     *  <p>Amount to remove from the <code>quantity</code> of the TextLineItem. If not set, the TextLineItem is removed from the ShoppingList. If this value matches or exceeds the current <code>quantity</code> of the TextLineItem, the TextLineItem is removed from the ShoppingList.</p>
077     */
078
079    public Long getQuantity() {
080        return this.quantity;
081    }
082
083    public void setTextLineItemId(final String textLineItemId) {
084        this.textLineItemId = textLineItemId;
085    }
086
087    public void setTextLineItemKey(final String textLineItemKey) {
088        this.textLineItemKey = textLineItemKey;
089    }
090
091    public void setQuantity(final Long quantity) {
092        this.quantity = quantity;
093    }
094
095    @Override
096    public boolean equals(Object o) {
097        if (this == o)
098            return true;
099
100        if (o == null || getClass() != o.getClass())
101            return false;
102
103        MyShoppingListRemoveTextLineItemActionImpl that = (MyShoppingListRemoveTextLineItemActionImpl) o;
104
105        return new EqualsBuilder().append(action, that.action)
106                .append(textLineItemId, that.textLineItemId)
107                .append(textLineItemKey, that.textLineItemKey)
108                .append(quantity, that.quantity)
109                .append(action, that.action)
110                .append(textLineItemId, that.textLineItemId)
111                .append(textLineItemKey, that.textLineItemKey)
112                .append(quantity, that.quantity)
113                .isEquals();
114    }
115
116    @Override
117    public int hashCode() {
118        return new HashCodeBuilder(17, 37).append(action)
119                .append(textLineItemId)
120                .append(textLineItemKey)
121                .append(quantity)
122                .toHashCode();
123    }
124
125}