001 002package com.commercetools.api.models.customer; 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>If <code>stores</code> is not empty, the Customer is specific to those Stores.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class CustomerImpl implements Customer, 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 String key; 032 033 private String customerNumber; 034 035 private String externalId; 036 037 private com.commercetools.api.models.common.LastModifiedBy lastModifiedBy; 038 039 private com.commercetools.api.models.common.CreatedBy createdBy; 040 041 private String email; 042 043 private String password; 044 045 private String firstName; 046 047 private String lastName; 048 049 private String middleName; 050 051 private String title; 052 053 private java.time.LocalDate dateOfBirth; 054 055 private String companyName; 056 057 private String vatId; 058 059 private java.util.List<com.commercetools.api.models.common.Address> addresses; 060 061 private String defaultShippingAddressId; 062 063 private java.util.List<String> shippingAddressIds; 064 065 private String defaultBillingAddressId; 066 067 private java.util.List<String> billingAddressIds; 068 069 private Boolean isEmailVerified; 070 071 private com.commercetools.api.models.customer_group.CustomerGroupReference customerGroup; 072 073 private com.commercetools.api.models.type.CustomFields custom; 074 075 private String locale; 076 077 private String salutation; 078 079 private java.util.List<com.commercetools.api.models.store.StoreKeyReference> stores; 080 081 private com.commercetools.api.models.customer.AuthenticationMode authenticationMode; 082 083 /** 084 * create instance with all properties 085 */ 086 @JsonCreator 087 CustomerImpl(@JsonProperty("id") final String id, @JsonProperty("version") final Long version, 088 @JsonProperty("createdAt") final java.time.ZonedDateTime createdAt, 089 @JsonProperty("lastModifiedAt") final java.time.ZonedDateTime lastModifiedAt, 090 @JsonProperty("key") final String key, @JsonProperty("customerNumber") final String customerNumber, 091 @JsonProperty("externalId") final String externalId, 092 @JsonProperty("lastModifiedBy") final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy, 093 @JsonProperty("createdBy") final com.commercetools.api.models.common.CreatedBy createdBy, 094 @JsonProperty("email") final String email, @JsonProperty("password") final String password, 095 @JsonProperty("firstName") final String firstName, @JsonProperty("lastName") final String lastName, 096 @JsonProperty("middleName") final String middleName, @JsonProperty("title") final String title, 097 @JsonProperty("dateOfBirth") final java.time.LocalDate dateOfBirth, 098 @JsonProperty("companyName") final String companyName, @JsonProperty("vatId") final String vatId, 099 @JsonProperty("addresses") final java.util.List<com.commercetools.api.models.common.Address> addresses, 100 @JsonProperty("defaultShippingAddressId") final String defaultShippingAddressId, 101 @JsonProperty("shippingAddressIds") final java.util.List<String> shippingAddressIds, 102 @JsonProperty("defaultBillingAddressId") final String defaultBillingAddressId, 103 @JsonProperty("billingAddressIds") final java.util.List<String> billingAddressIds, 104 @JsonProperty("isEmailVerified") final Boolean isEmailVerified, 105 @JsonProperty("customerGroup") final com.commercetools.api.models.customer_group.CustomerGroupReference customerGroup, 106 @JsonProperty("custom") final com.commercetools.api.models.type.CustomFields custom, 107 @JsonProperty("locale") final String locale, @JsonProperty("salutation") final String salutation, 108 @JsonProperty("stores") final java.util.List<com.commercetools.api.models.store.StoreKeyReference> stores, 109 @JsonProperty("authenticationMode") final com.commercetools.api.models.customer.AuthenticationMode authenticationMode) { 110 this.id = id; 111 this.version = version; 112 this.createdAt = createdAt; 113 this.lastModifiedAt = lastModifiedAt; 114 this.key = key; 115 this.customerNumber = customerNumber; 116 this.externalId = externalId; 117 this.lastModifiedBy = lastModifiedBy; 118 this.createdBy = createdBy; 119 this.email = email; 120 this.password = password; 121 this.firstName = firstName; 122 this.lastName = lastName; 123 this.middleName = middleName; 124 this.title = title; 125 this.dateOfBirth = dateOfBirth; 126 this.companyName = companyName; 127 this.vatId = vatId; 128 this.addresses = addresses; 129 this.defaultShippingAddressId = defaultShippingAddressId; 130 this.shippingAddressIds = shippingAddressIds; 131 this.defaultBillingAddressId = defaultBillingAddressId; 132 this.billingAddressIds = billingAddressIds; 133 this.isEmailVerified = isEmailVerified; 134 this.customerGroup = customerGroup; 135 this.custom = custom; 136 this.locale = locale; 137 this.salutation = salutation; 138 this.stores = stores; 139 this.authenticationMode = authenticationMode; 140 } 141 142 /** 143 * create empty instance 144 */ 145 public CustomerImpl() { 146 } 147 148 /** 149 * <p>Unique identifier of the Customer.</p> 150 */ 151 152 public String getId() { 153 return this.id; 154 } 155 156 /** 157 * <p>Current version of the Customer.</p> 158 */ 159 160 public Long getVersion() { 161 return this.version; 162 } 163 164 /** 165 * <p>Date and time (UTC) the Customer was initially created.</p> 166 */ 167 168 public java.time.ZonedDateTime getCreatedAt() { 169 return this.createdAt; 170 } 171 172 /** 173 * <p>Date and time (UTC) the Customer was last updated.</p> 174 */ 175 176 public java.time.ZonedDateTime getLastModifiedAt() { 177 return this.lastModifiedAt; 178 } 179 180 /** 181 * <p>User-defined unique identifier of the Customer.</p> 182 */ 183 184 public String getKey() { 185 return this.key; 186 } 187 188 /** 189 * <p>User-defined unique identifier of the Customer.</p> 190 * <p>Can be used to refer to a Customer in a human-readable way (in emails, invoices, and other correspondence).</p> 191 */ 192 193 public String getCustomerNumber() { 194 return this.customerNumber; 195 } 196 197 /** 198 * <p>Optional identifier for use in external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).</p> 199 */ 200 201 public String getExternalId() { 202 return this.externalId; 203 } 204 205 /** 206 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 207 */ 208 209 public com.commercetools.api.models.common.LastModifiedBy getLastModifiedBy() { 210 return this.lastModifiedBy; 211 } 212 213 /** 214 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 215 */ 216 217 public com.commercetools.api.models.common.CreatedBy getCreatedBy() { 218 return this.createdBy; 219 } 220 221 /** 222 * <p>Email address of the Customer that is unique for an entire Project or to a Store the Customer is assigned to. It is the mandatory unique identifier of a Customer.</p> 223 */ 224 225 public String getEmail() { 226 return this.email; 227 } 228 229 /** 230 * <p>Present only when <code>authenticationMode</code> is set to <code>Password</code>.</p> 231 */ 232 233 public String getPassword() { 234 return this.password; 235 } 236 237 /** 238 * <p>Given name (first name) of the Customer.</p> 239 */ 240 241 public String getFirstName() { 242 return this.firstName; 243 } 244 245 /** 246 * <p>Family name (last name) of the Customer.</p> 247 */ 248 249 public String getLastName() { 250 return this.lastName; 251 } 252 253 /** 254 * <p>Middle name of the Customer.</p> 255 */ 256 257 public String getMiddleName() { 258 return this.middleName; 259 } 260 261 /** 262 * <p>Title of the Customer, for example, 'Dr.'.</p> 263 */ 264 265 public String getTitle() { 266 return this.title; 267 } 268 269 /** 270 * <p>Date of birth of the Customer.</p> 271 */ 272 273 public java.time.LocalDate getDateOfBirth() { 274 return this.dateOfBirth; 275 } 276 277 /** 278 * <p>Company name of the Customer.</p> 279 */ 280 281 public String getCompanyName() { 282 return this.companyName; 283 } 284 285 /** 286 * <p>Individual VAT ID of the Customer.</p> 287 */ 288 289 public String getVatId() { 290 return this.vatId; 291 } 292 293 /** 294 * <p>Addresses used by the Customer.</p> 295 */ 296 297 public java.util.List<com.commercetools.api.models.common.Address> getAddresses() { 298 return this.addresses; 299 } 300 301 /** 302 * <p>ID of the address in <code>addresses</code> used as the default shipping address.</p> 303 */ 304 305 public String getDefaultShippingAddressId() { 306 return this.defaultShippingAddressId; 307 } 308 309 /** 310 * <p>IDs of addresses in <code>addresses</code> used as shipping addresses.</p> 311 */ 312 313 public java.util.List<String> getShippingAddressIds() { 314 return this.shippingAddressIds; 315 } 316 317 /** 318 * <p>ID of the address in <code>addresses</code> used as the default billing address.</p> 319 */ 320 321 public String getDefaultBillingAddressId() { 322 return this.defaultBillingAddressId; 323 } 324 325 /** 326 * <p>IDs of addresses in <code>addresses</code> used as billing addresses.</p> 327 */ 328 329 public java.util.List<String> getBillingAddressIds() { 330 return this.billingAddressIds; 331 } 332 333 /** 334 * <p>Indicates whether the email address of the Customer is verified.</p> 335 */ 336 337 public Boolean getIsEmailVerified() { 338 return this.isEmailVerified; 339 } 340 341 /** 342 * <p>CustomerGroup to which the Customer belongs.</p> 343 */ 344 345 public com.commercetools.api.models.customer_group.CustomerGroupReference getCustomerGroup() { 346 return this.customerGroup; 347 } 348 349 /** 350 * <p>Custom Fields for the Customer.</p> 351 */ 352 353 public com.commercetools.api.models.type.CustomFields getCustom() { 354 return this.custom; 355 } 356 357 /** 358 * <p>Preferred language of the Customer.</p> 359 */ 360 361 public String getLocale() { 362 return this.locale; 363 } 364 365 /** 366 * <p>Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.</p> 367 */ 368 369 public String getSalutation() { 370 return this.salutation; 371 } 372 373 /** 374 * <p>Stores to which the Customer is assigned to.</p> 375 * <ul> 376 * <li>If no Stores are specified, the Customer is a global customer, and can log in using the Password Flow for global Customers.</li> 377 * <li>If any Stores are specified, the Customer can only log in using the Password Flow for Customers in a Store for those specific Stores.</li> 378 * </ul> 379 */ 380 381 public java.util.List<com.commercetools.api.models.store.StoreKeyReference> getStores() { 382 return this.stores; 383 } 384 385 /** 386 * <p>Indicates whether the <code>password</code> is required for the Customer.</p> 387 */ 388 389 public com.commercetools.api.models.customer.AuthenticationMode getAuthenticationMode() { 390 return this.authenticationMode; 391 } 392 393 public void setId(final String id) { 394 this.id = id; 395 } 396 397 public void setVersion(final Long version) { 398 this.version = version; 399 } 400 401 public void setCreatedAt(final java.time.ZonedDateTime createdAt) { 402 this.createdAt = createdAt; 403 } 404 405 public void setLastModifiedAt(final java.time.ZonedDateTime lastModifiedAt) { 406 this.lastModifiedAt = lastModifiedAt; 407 } 408 409 public void setKey(final String key) { 410 this.key = key; 411 } 412 413 public void setCustomerNumber(final String customerNumber) { 414 this.customerNumber = customerNumber; 415 } 416 417 public void setExternalId(final String externalId) { 418 this.externalId = externalId; 419 } 420 421 public void setLastModifiedBy(final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy) { 422 this.lastModifiedBy = lastModifiedBy; 423 } 424 425 public void setCreatedBy(final com.commercetools.api.models.common.CreatedBy createdBy) { 426 this.createdBy = createdBy; 427 } 428 429 public void setEmail(final String email) { 430 this.email = email; 431 } 432 433 public void setPassword(final String password) { 434 this.password = password; 435 } 436 437 public void setFirstName(final String firstName) { 438 this.firstName = firstName; 439 } 440 441 public void setLastName(final String lastName) { 442 this.lastName = lastName; 443 } 444 445 public void setMiddleName(final String middleName) { 446 this.middleName = middleName; 447 } 448 449 public void setTitle(final String title) { 450 this.title = title; 451 } 452 453 public void setDateOfBirth(final java.time.LocalDate dateOfBirth) { 454 this.dateOfBirth = dateOfBirth; 455 } 456 457 public void setCompanyName(final String companyName) { 458 this.companyName = companyName; 459 } 460 461 public void setVatId(final String vatId) { 462 this.vatId = vatId; 463 } 464 465 public void setAddresses(final com.commercetools.api.models.common.Address... addresses) { 466 this.addresses = new ArrayList<>(Arrays.asList(addresses)); 467 } 468 469 public void setAddresses(final java.util.List<com.commercetools.api.models.common.Address> addresses) { 470 this.addresses = addresses; 471 } 472 473 public void setDefaultShippingAddressId(final String defaultShippingAddressId) { 474 this.defaultShippingAddressId = defaultShippingAddressId; 475 } 476 477 public void setShippingAddressIds(final String... shippingAddressIds) { 478 this.shippingAddressIds = new ArrayList<>(Arrays.asList(shippingAddressIds)); 479 } 480 481 public void setShippingAddressIds(final java.util.List<String> shippingAddressIds) { 482 this.shippingAddressIds = shippingAddressIds; 483 } 484 485 public void setDefaultBillingAddressId(final String defaultBillingAddressId) { 486 this.defaultBillingAddressId = defaultBillingAddressId; 487 } 488 489 public void setBillingAddressIds(final String... billingAddressIds) { 490 this.billingAddressIds = new ArrayList<>(Arrays.asList(billingAddressIds)); 491 } 492 493 public void setBillingAddressIds(final java.util.List<String> billingAddressIds) { 494 this.billingAddressIds = billingAddressIds; 495 } 496 497 public void setIsEmailVerified(final Boolean isEmailVerified) { 498 this.isEmailVerified = isEmailVerified; 499 } 500 501 public void setCustomerGroup( 502 final com.commercetools.api.models.customer_group.CustomerGroupReference customerGroup) { 503 this.customerGroup = customerGroup; 504 } 505 506 public void setCustom(final com.commercetools.api.models.type.CustomFields custom) { 507 this.custom = custom; 508 } 509 510 public void setLocale(final String locale) { 511 this.locale = locale; 512 } 513 514 public void setSalutation(final String salutation) { 515 this.salutation = salutation; 516 } 517 518 public void setStores(final com.commercetools.api.models.store.StoreKeyReference... stores) { 519 this.stores = new ArrayList<>(Arrays.asList(stores)); 520 } 521 522 public void setStores(final java.util.List<com.commercetools.api.models.store.StoreKeyReference> stores) { 523 this.stores = stores; 524 } 525 526 public void setAuthenticationMode( 527 final com.commercetools.api.models.customer.AuthenticationMode authenticationMode) { 528 this.authenticationMode = authenticationMode; 529 } 530 531 @Override 532 public boolean equals(Object o) { 533 if (this == o) 534 return true; 535 536 if (o == null || getClass() != o.getClass()) 537 return false; 538 539 CustomerImpl that = (CustomerImpl) o; 540 541 return new EqualsBuilder().append(id, that.id) 542 .append(version, that.version) 543 .append(createdAt, that.createdAt) 544 .append(lastModifiedAt, that.lastModifiedAt) 545 .append(key, that.key) 546 .append(customerNumber, that.customerNumber) 547 .append(externalId, that.externalId) 548 .append(lastModifiedBy, that.lastModifiedBy) 549 .append(createdBy, that.createdBy) 550 .append(email, that.email) 551 .append(password, that.password) 552 .append(firstName, that.firstName) 553 .append(lastName, that.lastName) 554 .append(middleName, that.middleName) 555 .append(title, that.title) 556 .append(dateOfBirth, that.dateOfBirth) 557 .append(companyName, that.companyName) 558 .append(vatId, that.vatId) 559 .append(addresses, that.addresses) 560 .append(defaultShippingAddressId, that.defaultShippingAddressId) 561 .append(shippingAddressIds, that.shippingAddressIds) 562 .append(defaultBillingAddressId, that.defaultBillingAddressId) 563 .append(billingAddressIds, that.billingAddressIds) 564 .append(isEmailVerified, that.isEmailVerified) 565 .append(customerGroup, that.customerGroup) 566 .append(custom, that.custom) 567 .append(locale, that.locale) 568 .append(salutation, that.salutation) 569 .append(stores, that.stores) 570 .append(authenticationMode, that.authenticationMode) 571 .append(id, that.id) 572 .append(version, that.version) 573 .append(createdAt, that.createdAt) 574 .append(lastModifiedAt, that.lastModifiedAt) 575 .append(key, that.key) 576 .append(customerNumber, that.customerNumber) 577 .append(externalId, that.externalId) 578 .append(lastModifiedBy, that.lastModifiedBy) 579 .append(createdBy, that.createdBy) 580 .append(email, that.email) 581 .append(password, that.password) 582 .append(firstName, that.firstName) 583 .append(lastName, that.lastName) 584 .append(middleName, that.middleName) 585 .append(title, that.title) 586 .append(dateOfBirth, that.dateOfBirth) 587 .append(companyName, that.companyName) 588 .append(vatId, that.vatId) 589 .append(addresses, that.addresses) 590 .append(defaultShippingAddressId, that.defaultShippingAddressId) 591 .append(shippingAddressIds, that.shippingAddressIds) 592 .append(defaultBillingAddressId, that.defaultBillingAddressId) 593 .append(billingAddressIds, that.billingAddressIds) 594 .append(isEmailVerified, that.isEmailVerified) 595 .append(customerGroup, that.customerGroup) 596 .append(custom, that.custom) 597 .append(locale, that.locale) 598 .append(salutation, that.salutation) 599 .append(stores, that.stores) 600 .append(authenticationMode, that.authenticationMode) 601 .isEquals(); 602 } 603 604 @Override 605 public int hashCode() { 606 return new HashCodeBuilder(17, 37).append(id) 607 .append(version) 608 .append(createdAt) 609 .append(lastModifiedAt) 610 .append(key) 611 .append(customerNumber) 612 .append(externalId) 613 .append(lastModifiedBy) 614 .append(createdBy) 615 .append(email) 616 .append(password) 617 .append(firstName) 618 .append(lastName) 619 .append(middleName) 620 .append(title) 621 .append(dateOfBirth) 622 .append(companyName) 623 .append(vatId) 624 .append(addresses) 625 .append(defaultShippingAddressId) 626 .append(shippingAddressIds) 627 .append(defaultBillingAddressId) 628 .append(billingAddressIds) 629 .append(isEmailVerified) 630 .append(customerGroup) 631 .append(custom) 632 .append(locale) 633 .append(salutation) 634 .append(stores) 635 .append(authenticationMode) 636 .toHashCode(); 637 } 638 639}