001 002package com.commercetools.api.models.shipping_method; 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 * ShippingMethod 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class ShippingMethodImpl implements ShippingMethod, ModelBase { 022 023 private String id; 024 025 private Long version; 026 027 private java.time.ZonedDateTime createdAt; 028 029 private java.time.ZonedDateTime lastModifiedAt; 030 031 private com.commercetools.api.models.common.LastModifiedBy lastModifiedBy; 032 033 private com.commercetools.api.models.common.CreatedBy createdBy; 034 035 private String key; 036 037 private String name; 038 039 private com.commercetools.api.models.common.LocalizedString localizedName; 040 041 @Deprecated 042 private String description; 043 044 private com.commercetools.api.models.common.LocalizedString localizedDescription; 045 046 private com.commercetools.api.models.tax_category.TaxCategoryReference taxCategory; 047 048 private java.util.List<com.commercetools.api.models.shipping_method.ZoneRate> zoneRates; 049 050 private Boolean isDefault; 051 052 private String predicate; 053 054 private com.commercetools.api.models.type.CustomFields custom; 055 056 /** 057 * create instance with all properties 058 */ 059 @JsonCreator 060 ShippingMethodImpl(@JsonProperty("id") final String id, @JsonProperty("version") final Long version, 061 @JsonProperty("createdAt") final java.time.ZonedDateTime createdAt, 062 @JsonProperty("lastModifiedAt") final java.time.ZonedDateTime lastModifiedAt, 063 @JsonProperty("lastModifiedBy") final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy, 064 @JsonProperty("createdBy") final com.commercetools.api.models.common.CreatedBy createdBy, 065 @JsonProperty("key") final String key, @JsonProperty("name") final String name, 066 @JsonProperty("localizedName") final com.commercetools.api.models.common.LocalizedString localizedName, 067 @JsonProperty("description") final String description, 068 @JsonProperty("localizedDescription") final com.commercetools.api.models.common.LocalizedString localizedDescription, 069 @JsonProperty("taxCategory") final com.commercetools.api.models.tax_category.TaxCategoryReference taxCategory, 070 @JsonProperty("zoneRates") final java.util.List<com.commercetools.api.models.shipping_method.ZoneRate> zoneRates, 071 @JsonProperty("isDefault") final Boolean isDefault, @JsonProperty("predicate") final String predicate, 072 @JsonProperty("custom") final com.commercetools.api.models.type.CustomFields custom) { 073 this.id = id; 074 this.version = version; 075 this.createdAt = createdAt; 076 this.lastModifiedAt = lastModifiedAt; 077 this.lastModifiedBy = lastModifiedBy; 078 this.createdBy = createdBy; 079 this.key = key; 080 this.name = name; 081 this.localizedName = localizedName; 082 this.description = description; 083 this.localizedDescription = localizedDescription; 084 this.taxCategory = taxCategory; 085 this.zoneRates = zoneRates; 086 this.isDefault = isDefault; 087 this.predicate = predicate; 088 this.custom = custom; 089 } 090 091 /** 092 * create empty instance 093 */ 094 public ShippingMethodImpl() { 095 } 096 097 /** 098 * <p>Unique identifier of the ShippingMethod.</p> 099 */ 100 101 public String getId() { 102 return this.id; 103 } 104 105 /** 106 * <p>Current version of the ShippingMethod.</p> 107 */ 108 109 public Long getVersion() { 110 return this.version; 111 } 112 113 /** 114 * <p>Date and time (UTC) the ShippingMethod was initially created.</p> 115 */ 116 117 public java.time.ZonedDateTime getCreatedAt() { 118 return this.createdAt; 119 } 120 121 /** 122 * <p>Date and time (UTC) the ShippingMethod was last updated.</p> 123 */ 124 125 public java.time.ZonedDateTime getLastModifiedAt() { 126 return this.lastModifiedAt; 127 } 128 129 /** 130 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 131 */ 132 133 public com.commercetools.api.models.common.LastModifiedBy getLastModifiedBy() { 134 return this.lastModifiedBy; 135 } 136 137 /** 138 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 139 */ 140 141 public com.commercetools.api.models.common.CreatedBy getCreatedBy() { 142 return this.createdBy; 143 } 144 145 /** 146 * <p>User-defined unique identifier of the ShippingMethod.</p> 147 */ 148 149 public String getKey() { 150 return this.key; 151 } 152 153 /** 154 * <p>Name of the ShippingMethod.</p> 155 */ 156 157 public String getName() { 158 return this.name; 159 } 160 161 /** 162 * <p>Localized name of the ShippingMethod.</p> 163 */ 164 165 public com.commercetools.api.models.common.LocalizedString getLocalizedName() { 166 return this.localizedName; 167 } 168 169 /** 170 * <p>Description of the ShippingMethod.</p> 171 */ 172 @Deprecated 173 public String getDescription() { 174 return this.description; 175 } 176 177 /** 178 * <p>Localized description of the ShippingMethod.</p> 179 */ 180 181 public com.commercetools.api.models.common.LocalizedString getLocalizedDescription() { 182 return this.localizedDescription; 183 } 184 185 /** 186 * <p>TaxCategory of all ZoneRates of the ShippingMethod.</p> 187 */ 188 189 public com.commercetools.api.models.tax_category.TaxCategoryReference getTaxCategory() { 190 return this.taxCategory; 191 } 192 193 /** 194 * <p>Defines ShippingRates (prices) for specific Zones.</p> 195 */ 196 197 public java.util.List<com.commercetools.api.models.shipping_method.ZoneRate> getZoneRates() { 198 return this.zoneRates; 199 } 200 201 /** 202 * <p>If <code>true</code> this ShippingMethod is the Project's default ShippingMethod.</p> 203 */ 204 205 public Boolean getIsDefault() { 206 return this.isDefault; 207 } 208 209 /** 210 * <p>Valid Cart predicate to select a ShippingMethod for a Cart.</p> 211 */ 212 213 public String getPredicate() { 214 return this.predicate; 215 } 216 217 /** 218 * <p>Custom Fields of the ShippingMethod.</p> 219 */ 220 221 public com.commercetools.api.models.type.CustomFields getCustom() { 222 return this.custom; 223 } 224 225 public void setId(final String id) { 226 this.id = id; 227 } 228 229 public void setVersion(final Long version) { 230 this.version = version; 231 } 232 233 public void setCreatedAt(final java.time.ZonedDateTime createdAt) { 234 this.createdAt = createdAt; 235 } 236 237 public void setLastModifiedAt(final java.time.ZonedDateTime lastModifiedAt) { 238 this.lastModifiedAt = lastModifiedAt; 239 } 240 241 public void setLastModifiedBy(final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy) { 242 this.lastModifiedBy = lastModifiedBy; 243 } 244 245 public void setCreatedBy(final com.commercetools.api.models.common.CreatedBy createdBy) { 246 this.createdBy = createdBy; 247 } 248 249 public void setKey(final String key) { 250 this.key = key; 251 } 252 253 public void setName(final String name) { 254 this.name = name; 255 } 256 257 public void setLocalizedName(final com.commercetools.api.models.common.LocalizedString localizedName) { 258 this.localizedName = localizedName; 259 } 260 261 @Deprecated 262 public void setDescription(final String description) { 263 this.description = description; 264 } 265 266 public void setLocalizedDescription( 267 final com.commercetools.api.models.common.LocalizedString localizedDescription) { 268 this.localizedDescription = localizedDescription; 269 } 270 271 public void setTaxCategory(final com.commercetools.api.models.tax_category.TaxCategoryReference taxCategory) { 272 this.taxCategory = taxCategory; 273 } 274 275 public void setZoneRates(final com.commercetools.api.models.shipping_method.ZoneRate... zoneRates) { 276 this.zoneRates = new ArrayList<>(Arrays.asList(zoneRates)); 277 } 278 279 public void setZoneRates(final java.util.List<com.commercetools.api.models.shipping_method.ZoneRate> zoneRates) { 280 this.zoneRates = zoneRates; 281 } 282 283 public void setIsDefault(final Boolean isDefault) { 284 this.isDefault = isDefault; 285 } 286 287 public void setPredicate(final String predicate) { 288 this.predicate = predicate; 289 } 290 291 public void setCustom(final com.commercetools.api.models.type.CustomFields custom) { 292 this.custom = custom; 293 } 294 295 @Override 296 public boolean equals(Object o) { 297 if (this == o) 298 return true; 299 300 if (o == null || getClass() != o.getClass()) 301 return false; 302 303 ShippingMethodImpl that = (ShippingMethodImpl) o; 304 305 return new EqualsBuilder().append(id, that.id) 306 .append(version, that.version) 307 .append(createdAt, that.createdAt) 308 .append(lastModifiedAt, that.lastModifiedAt) 309 .append(lastModifiedBy, that.lastModifiedBy) 310 .append(createdBy, that.createdBy) 311 .append(key, that.key) 312 .append(name, that.name) 313 .append(localizedName, that.localizedName) 314 .append(description, that.description) 315 .append(localizedDescription, that.localizedDescription) 316 .append(taxCategory, that.taxCategory) 317 .append(zoneRates, that.zoneRates) 318 .append(isDefault, that.isDefault) 319 .append(predicate, that.predicate) 320 .append(custom, that.custom) 321 .isEquals(); 322 } 323 324 @Override 325 public int hashCode() { 326 return new HashCodeBuilder(17, 37).append(id) 327 .append(version) 328 .append(createdAt) 329 .append(lastModifiedAt) 330 .append(lastModifiedBy) 331 .append(createdBy) 332 .append(key) 333 .append(name) 334 .append(localizedName) 335 .append(description) 336 .append(localizedDescription) 337 .append(taxCategory) 338 .append(zoneRates) 339 .append(isDefault) 340 .append(predicate) 341 .append(custom) 342 .toHashCode(); 343 } 344 345}