001
002package com.commercetools.api.models.shopping_list;
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 * ShoppingListSetLineItemCustomFieldAction
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class ShoppingListSetLineItemCustomFieldActionImpl
022        implements ShoppingListSetLineItemCustomFieldAction, ModelBase {
023
024    private String action;
025
026    private String lineItemId;
027
028    private String lineItemKey;
029
030    private String name;
031
032    private java.lang.Object value;
033
034    /**
035     * create instance with all properties
036     */
037    @JsonCreator
038    ShoppingListSetLineItemCustomFieldActionImpl(@JsonProperty("lineItemId") final String lineItemId,
039            @JsonProperty("lineItemKey") final String lineItemKey, @JsonProperty("name") final String name,
040            @JsonProperty("value") final java.lang.Object value) {
041        this.lineItemId = lineItemId;
042        this.lineItemKey = lineItemKey;
043        this.name = name;
044        this.value = value;
045        this.action = SET_LINE_ITEM_CUSTOM_FIELD;
046    }
047
048    /**
049     * create empty instance
050     */
051    public ShoppingListSetLineItemCustomFieldActionImpl() {
052        this.action = SET_LINE_ITEM_CUSTOM_FIELD;
053    }
054
055    /**
056     *
057     */
058
059    public String getAction() {
060        return this.action;
061    }
062
063    /**
064     *  <p>The <code>id</code> of the ShoppingListLineItem to update. Either <code>lineItemId</code> or <code>lineItemKey</code> is required.</p>
065     */
066
067    public String getLineItemId() {
068        return this.lineItemId;
069    }
070
071    /**
072     *  <p>The <code>key</code> of the ShoppingListLineItem to update. Either <code>lineItemId</code> or <code>lineItemKey</code> is required.</p>
073     */
074
075    public String getLineItemKey() {
076        return this.lineItemKey;
077    }
078
079    /**
080     *  <p>Name of the Custom Field.</p>
081     */
082
083    public String getName() {
084        return this.name;
085    }
086
087    /**
088     *  <p>If <code>value</code> is absent or <code>null</code>, this field will be removed if it exists. Removing a field that does not exist returns an InvalidOperation error. If <code>value</code> is provided, it is set for the field defined by <code>name</code>.</p>
089     */
090
091    public java.lang.Object getValue() {
092        return this.value;
093    }
094
095    public void setLineItemId(final String lineItemId) {
096        this.lineItemId = lineItemId;
097    }
098
099    public void setLineItemKey(final String lineItemKey) {
100        this.lineItemKey = lineItemKey;
101    }
102
103    public void setName(final String name) {
104        this.name = name;
105    }
106
107    public void setValue(final java.lang.Object value) {
108        this.value = value;
109    }
110
111    @Override
112    public boolean equals(Object o) {
113        if (this == o)
114            return true;
115
116        if (o == null || getClass() != o.getClass())
117            return false;
118
119        ShoppingListSetLineItemCustomFieldActionImpl that = (ShoppingListSetLineItemCustomFieldActionImpl) o;
120
121        return new EqualsBuilder().append(action, that.action)
122                .append(lineItemId, that.lineItemId)
123                .append(lineItemKey, that.lineItemKey)
124                .append(name, that.name)
125                .append(value, that.value)
126                .append(action, that.action)
127                .append(lineItemId, that.lineItemId)
128                .append(lineItemKey, that.lineItemKey)
129                .append(name, that.name)
130                .append(value, that.value)
131                .isEquals();
132    }
133
134    @Override
135    public int hashCode() {
136        return new HashCodeBuilder(17, 37).append(action)
137                .append(lineItemId)
138                .append(lineItemKey)
139                .append(name)
140                .append(value)
141                .toHashCode();
142    }
143
144}