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 *  <p>Changing an address of the Customer produces the CustomerAddressChanged Message.</p>
019 *  <p>Either <code>addressId</code> or <code>addressKey</code> is required.</p>
020 */
021@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
022public class MyCustomerChangeAddressActionImpl implements MyCustomerChangeAddressAction, ModelBase {
023
024    private String action;
025
026    private String addressId;
027
028    private String addressKey;
029
030    private com.commercetools.api.models.common.BaseAddress address;
031
032    /**
033     * create instance with all properties
034     */
035    @JsonCreator
036    MyCustomerChangeAddressActionImpl(@JsonProperty("addressId") final String addressId,
037            @JsonProperty("addressKey") final String addressKey,
038            @JsonProperty("address") final com.commercetools.api.models.common.BaseAddress address) {
039        this.addressId = addressId;
040        this.addressKey = addressKey;
041        this.address = address;
042        this.action = CHANGE_ADDRESS;
043    }
044
045    /**
046     * create empty instance
047     */
048    public MyCustomerChangeAddressActionImpl() {
049        this.action = CHANGE_ADDRESS;
050    }
051
052    /**
053     *
054     */
055
056    public String getAction() {
057        return this.action;
058    }
059
060    /**
061     *  <p><code>id</code> of the Address to change.</p>
062     */
063
064    public String getAddressId() {
065        return this.addressId;
066    }
067
068    /**
069     *  <p><code>key</code> of the Address to change.</p>
070     */
071
072    public String getAddressKey() {
073        return this.addressKey;
074    }
075
076    /**
077     *  <p>Value to set.</p>
078     */
079
080    public com.commercetools.api.models.common.BaseAddress getAddress() {
081        return this.address;
082    }
083
084    public void setAddressId(final String addressId) {
085        this.addressId = addressId;
086    }
087
088    public void setAddressKey(final String addressKey) {
089        this.addressKey = addressKey;
090    }
091
092    public void setAddress(final com.commercetools.api.models.common.BaseAddress address) {
093        this.address = address;
094    }
095
096    @Override
097    public boolean equals(Object o) {
098        if (this == o)
099            return true;
100
101        if (o == null || getClass() != o.getClass())
102            return false;
103
104        MyCustomerChangeAddressActionImpl that = (MyCustomerChangeAddressActionImpl) o;
105
106        return new EqualsBuilder().append(action, that.action)
107                .append(addressId, that.addressId)
108                .append(addressKey, that.addressKey)
109                .append(address, that.address)
110                .isEquals();
111    }
112
113    @Override
114    public int hashCode() {
115        return new HashCodeBuilder(17, 37).append(action)
116                .append(addressId)
117                .append(addressKey)
118                .append(address)
119                .toHashCode();
120    }
121
122}