001 002package com.commercetools.api.models.store; 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 * StoreDraft 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class StoreDraftImpl implements StoreDraft, ModelBase { 022 023 private String key; 024 025 private com.commercetools.api.models.common.LocalizedString name; 026 027 private java.util.List<String> languages; 028 029 private java.util.List<com.commercetools.api.models.store_country.StoreCountry> countries; 030 031 private java.util.List<com.commercetools.api.models.channel.ChannelResourceIdentifier> distributionChannels; 032 033 private java.util.List<com.commercetools.api.models.channel.ChannelResourceIdentifier> supplyChannels; 034 035 private java.util.List<com.commercetools.api.models.store.ProductSelectionSettingDraft> productSelections; 036 037 private com.commercetools.api.models.type.CustomFieldsDraft custom; 038 039 /** 040 * create instance with all properties 041 */ 042 @JsonCreator 043 StoreDraftImpl(@JsonProperty("key") final String key, 044 @JsonProperty("name") final com.commercetools.api.models.common.LocalizedString name, 045 @JsonProperty("languages") final java.util.List<String> languages, 046 @JsonProperty("countries") final java.util.List<com.commercetools.api.models.store_country.StoreCountry> countries, 047 @JsonProperty("distributionChannels") final java.util.List<com.commercetools.api.models.channel.ChannelResourceIdentifier> distributionChannels, 048 @JsonProperty("supplyChannels") final java.util.List<com.commercetools.api.models.channel.ChannelResourceIdentifier> supplyChannels, 049 @JsonProperty("productSelections") final java.util.List<com.commercetools.api.models.store.ProductSelectionSettingDraft> productSelections, 050 @JsonProperty("custom") final com.commercetools.api.models.type.CustomFieldsDraft custom) { 051 this.key = key; 052 this.name = name; 053 this.languages = languages; 054 this.countries = countries; 055 this.distributionChannels = distributionChannels; 056 this.supplyChannels = supplyChannels; 057 this.productSelections = productSelections; 058 this.custom = custom; 059 } 060 061 /** 062 * create empty instance 063 */ 064 public StoreDraftImpl() { 065 } 066 067 /** 068 * <p>User-defined unique and immutable identifier for the Store. Keys can only contain alphanumeric characters, underscores, and hyphens.</p> 069 */ 070 071 public String getKey() { 072 return this.key; 073 } 074 075 /** 076 * <p>Name of the Store.</p> 077 */ 078 079 public com.commercetools.api.models.common.LocalizedString getName() { 080 return this.name; 081 } 082 083 /** 084 * <p>Languages defined in Project. Only languages defined in the Project can be used.</p> 085 */ 086 087 public java.util.List<String> getLanguages() { 088 return this.languages; 089 } 090 091 /** 092 * <p>Countries defined for the Store.</p> 093 */ 094 095 public java.util.List<com.commercetools.api.models.store_country.StoreCountry> getCountries() { 096 return this.countries; 097 } 098 099 /** 100 * <p>ResourceIdentifier of a Channel with <code>ProductDistribution</code> ChannelRoleEnum.</p> 101 */ 102 103 public java.util.List<com.commercetools.api.models.channel.ChannelResourceIdentifier> getDistributionChannels() { 104 return this.distributionChannels; 105 } 106 107 /** 108 * <p>ResourceIdentifier of a Channel with <code>InventorySupply</code> ChannelRoleEnum.</p> 109 */ 110 111 public java.util.List<com.commercetools.api.models.channel.ChannelResourceIdentifier> getSupplyChannels() { 112 return this.supplyChannels; 113 } 114 115 /** 116 * <p>Controls availability of Products for this Store via active/inactive Product Selections:</p> 117 * <ul> 118 * <li>Leave empty if all Products in the Project should be available in this Store.</li> 119 * <li>If only <code>inactive</code> Product Selections with <code>IndividualExclusion</code> ProductSelectionMode are provided, all the Products are available in this Store.</li> 120 * <li>If all the Product Selections provided are <code>inactive</code> and there's at least a Product Selection of mode <code>Individual</code>, no Product is available in this Store.</li> 121 * <li>If at least an <code>active</code> Product Selection is provided, only <code>active</code> Product Selections are considered to compute the availability in this Store.</li> 122 * </ul> 123 */ 124 125 public java.util.List<com.commercetools.api.models.store.ProductSelectionSettingDraft> getProductSelections() { 126 return this.productSelections; 127 } 128 129 /** 130 * <p>Custom fields for the Store.</p> 131 */ 132 133 public com.commercetools.api.models.type.CustomFieldsDraft getCustom() { 134 return this.custom; 135 } 136 137 public void setKey(final String key) { 138 this.key = key; 139 } 140 141 public void setName(final com.commercetools.api.models.common.LocalizedString name) { 142 this.name = name; 143 } 144 145 public void setLanguages(final String... languages) { 146 this.languages = new ArrayList<>(Arrays.asList(languages)); 147 } 148 149 public void setLanguages(final java.util.List<String> languages) { 150 this.languages = languages; 151 } 152 153 public void setCountries(final com.commercetools.api.models.store_country.StoreCountry... countries) { 154 this.countries = new ArrayList<>(Arrays.asList(countries)); 155 } 156 157 public void setCountries(final java.util.List<com.commercetools.api.models.store_country.StoreCountry> countries) { 158 this.countries = countries; 159 } 160 161 public void setDistributionChannels( 162 final com.commercetools.api.models.channel.ChannelResourceIdentifier... distributionChannels) { 163 this.distributionChannels = new ArrayList<>(Arrays.asList(distributionChannels)); 164 } 165 166 public void setDistributionChannels( 167 final java.util.List<com.commercetools.api.models.channel.ChannelResourceIdentifier> distributionChannels) { 168 this.distributionChannels = distributionChannels; 169 } 170 171 public void setSupplyChannels( 172 final com.commercetools.api.models.channel.ChannelResourceIdentifier... supplyChannels) { 173 this.supplyChannels = new ArrayList<>(Arrays.asList(supplyChannels)); 174 } 175 176 public void setSupplyChannels( 177 final java.util.List<com.commercetools.api.models.channel.ChannelResourceIdentifier> supplyChannels) { 178 this.supplyChannels = supplyChannels; 179 } 180 181 public void setProductSelections( 182 final com.commercetools.api.models.store.ProductSelectionSettingDraft... productSelections) { 183 this.productSelections = new ArrayList<>(Arrays.asList(productSelections)); 184 } 185 186 public void setProductSelections( 187 final java.util.List<com.commercetools.api.models.store.ProductSelectionSettingDraft> productSelections) { 188 this.productSelections = productSelections; 189 } 190 191 public void setCustom(final com.commercetools.api.models.type.CustomFieldsDraft custom) { 192 this.custom = custom; 193 } 194 195 @Override 196 public boolean equals(Object o) { 197 if (this == o) 198 return true; 199 200 if (o == null || getClass() != o.getClass()) 201 return false; 202 203 StoreDraftImpl that = (StoreDraftImpl) o; 204 205 return new EqualsBuilder().append(key, that.key) 206 .append(name, that.name) 207 .append(languages, that.languages) 208 .append(countries, that.countries) 209 .append(distributionChannels, that.distributionChannels) 210 .append(supplyChannels, that.supplyChannels) 211 .append(productSelections, that.productSelections) 212 .append(custom, that.custom) 213 .isEquals(); 214 } 215 216 @Override 217 public int hashCode() { 218 return new HashCodeBuilder(17, 37).append(key) 219 .append(name) 220 .append(languages) 221 .append(countries) 222 .append(distributionChannels) 223 .append(supplyChannels) 224 .append(productSelections) 225 .append(custom) 226 .toHashCode(); 227 } 228 229}