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