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>Setting the country can lead to changes in the LineItem prices.</p>
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class MyCartSetCountryActionImpl implements MyCartSetCountryAction, ModelBase {
022
023    private String action;
024
025    private String country;
026
027    /**
028     * create instance with all properties
029     */
030    @JsonCreator
031    MyCartSetCountryActionImpl(@JsonProperty("country") final String country) {
032        this.country = country;
033        this.action = SET_COUNTRY;
034    }
035
036    /**
037     * create empty instance
038     */
039    public MyCartSetCountryActionImpl() {
040        this.action = SET_COUNTRY;
041    }
042
043    /**
044     *
045     */
046
047    public String getAction() {
048        return this.action;
049    }
050
051    /**
052     *  <p>Value to set. If empty, any existing value is removed.</p>
053     *  <p>If the Cart is bound to a <code>store</code>, the provided value must be included in the Store's <code>countries</code>. Otherwise a CountryNotConfiguredInStore error is returned.</p>
054     */
055
056    public String getCountry() {
057        return this.country;
058    }
059
060    public void setCountry(final String country) {
061        this.country = country;
062    }
063
064    @Override
065    public boolean equals(Object o) {
066        if (this == o)
067            return true;
068
069        if (o == null || getClass() != o.getClass())
070            return false;
071
072        MyCartSetCountryActionImpl that = (MyCartSetCountryActionImpl) o;
073
074        return new EqualsBuilder().append(action, that.action).append(country, that.country).isEquals();
075    }
076
077    @Override
078    public int hashCode() {
079        return new HashCodeBuilder(17, 37).append(action).append(country).toHashCode();
080    }
081
082}