001
002package com.commercetools.api.models.business_unit;
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>Sets the Stores of the Business Unit. Can only be set if the Business Unit <code>storeMode</code> is <code>Explicit</code>. Carts and Orders created after the Set Stores update must use the new Stores of the Business Unit and, if set, their Product Selections, and Channels. Orders created before the Set Stores update action remain unchanged. Setting the Stores on a Business Unit generates a BusinessUnitStoresSet Message.</p>
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class BusinessUnitSetStoresActionImpl implements BusinessUnitSetStoresAction, ModelBase {
022
023    private String action;
024
025    private java.util.List<com.commercetools.api.models.store.StoreResourceIdentifier> stores;
026
027    /**
028     * create instance with all properties
029     */
030    @JsonCreator
031    BusinessUnitSetStoresActionImpl(
032            @JsonProperty("stores") final java.util.List<com.commercetools.api.models.store.StoreResourceIdentifier> stores) {
033        this.stores = stores;
034        this.action = SET_STORES;
035    }
036
037    /**
038     * create empty instance
039     */
040    public BusinessUnitSetStoresActionImpl() {
041        this.action = SET_STORES;
042    }
043
044    /**
045     *
046     */
047
048    public String getAction() {
049        return this.action;
050    }
051
052    /**
053     *  <p>Stores to set. Overrides the current list of Stores.</p>
054     */
055
056    public java.util.List<com.commercetools.api.models.store.StoreResourceIdentifier> getStores() {
057        return this.stores;
058    }
059
060    public void setStores(final com.commercetools.api.models.store.StoreResourceIdentifier... stores) {
061        this.stores = new ArrayList<>(Arrays.asList(stores));
062    }
063
064    public void setStores(final java.util.List<com.commercetools.api.models.store.StoreResourceIdentifier> stores) {
065        this.stores = stores;
066    }
067
068    @Override
069    public boolean equals(Object o) {
070        if (this == o)
071            return true;
072
073        if (o == null || getClass() != o.getClass())
074            return false;
075
076        BusinessUnitSetStoresActionImpl that = (BusinessUnitSetStoresActionImpl) o;
077
078        return new EqualsBuilder().append(action, that.action)
079                .append(stores, that.stores)
080                .append(action, that.action)
081                .append(stores, that.stores)
082                .isEquals();
083    }
084
085    @Override
086    public int hashCode() {
087        return new HashCodeBuilder(17, 37).append(action).append(stores).toHashCode();
088    }
089
090}