001 002package com.commercetools.api.models.shopping_list; 003 004import java.util.*; 005import java.util.function.Function; 006 007import javax.annotation.Nullable; 008 009import io.vrap.rmf.base.client.Builder; 010import io.vrap.rmf.base.client.utils.Generated; 011 012/** 013 * ShoppingListBuilder 014 * <hr> 015 * Example to create an instance using the builder pattern 016 * <div class=code-example> 017 * <pre><code class='java'> 018 * ShoppingList shoppingList = ShoppingList.builder() 019 * .id("{id}") 020 * .version(0.3) 021 * .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z")) 022 * .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z")) 023 * .name(nameBuilder -> nameBuilder) 024 * .plusLineItems(lineItemsBuilder -> lineItemsBuilder) 025 * .plusTextLineItems(textLineItemsBuilder -> textLineItemsBuilder) 026 * .build() 027 * </code></pre> 028 * </div> 029 */ 030@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 031public class ShoppingListBuilder implements Builder<ShoppingList> { 032 033 private String id; 034 035 private Long version; 036 037 private java.time.ZonedDateTime createdAt; 038 039 private java.time.ZonedDateTime lastModifiedAt; 040 041 private com.commercetools.api.models.common.LocalizedString name; 042 043 @Nullable 044 private String key; 045 046 @Nullable 047 private com.commercetools.api.models.customer.CustomerReference customer; 048 049 @Nullable 050 private com.commercetools.api.models.common.LocalizedString slug; 051 052 @Nullable 053 private com.commercetools.api.models.common.LocalizedString description; 054 055 private java.util.List<com.commercetools.api.models.shopping_list.ShoppingListLineItem> lineItems; 056 057 private java.util.List<com.commercetools.api.models.shopping_list.TextLineItem> textLineItems; 058 059 @Nullable 060 private Long deleteDaysAfterLastModification; 061 062 @Nullable 063 private String anonymousId; 064 065 @Nullable 066 private com.commercetools.api.models.store.StoreKeyReference store; 067 068 @Nullable 069 private com.commercetools.api.models.type.CustomFields custom; 070 071 @Nullable 072 private com.commercetools.api.models.common.LastModifiedBy lastModifiedBy; 073 074 @Nullable 075 private com.commercetools.api.models.common.CreatedBy createdBy; 076 077 /** 078 * <p>Unique identifier of the ShoppingList.</p> 079 * @param id value to be set 080 * @return Builder 081 */ 082 083 public ShoppingListBuilder id(final String id) { 084 this.id = id; 085 return this; 086 } 087 088 /** 089 * <p>Current version of the ShoppingList.</p> 090 * @param version value to be set 091 * @return Builder 092 */ 093 094 public ShoppingListBuilder version(final Long version) { 095 this.version = version; 096 return this; 097 } 098 099 /** 100 * <p>Date and time (UTC) the ShoppingList was initially created.</p> 101 * @param createdAt value to be set 102 * @return Builder 103 */ 104 105 public ShoppingListBuilder createdAt(final java.time.ZonedDateTime createdAt) { 106 this.createdAt = createdAt; 107 return this; 108 } 109 110 /** 111 * <p>Date and time (UTC) the ShoppingList was last updated.</p> 112 * @param lastModifiedAt value to be set 113 * @return Builder 114 */ 115 116 public ShoppingListBuilder lastModifiedAt(final java.time.ZonedDateTime lastModifiedAt) { 117 this.lastModifiedAt = lastModifiedAt; 118 return this; 119 } 120 121 /** 122 * <p>Name of the ShoppingList.</p> 123 * @param builder function to build the name value 124 * @return Builder 125 */ 126 127 public ShoppingListBuilder name( 128 Function<com.commercetools.api.models.common.LocalizedStringBuilder, com.commercetools.api.models.common.LocalizedStringBuilder> builder) { 129 this.name = builder.apply(com.commercetools.api.models.common.LocalizedStringBuilder.of()).build(); 130 return this; 131 } 132 133 /** 134 * <p>Name of the ShoppingList.</p> 135 * @param builder function to build the name value 136 * @return Builder 137 */ 138 139 public ShoppingListBuilder withName( 140 Function<com.commercetools.api.models.common.LocalizedStringBuilder, com.commercetools.api.models.common.LocalizedString> builder) { 141 this.name = builder.apply(com.commercetools.api.models.common.LocalizedStringBuilder.of()); 142 return this; 143 } 144 145 /** 146 * <p>Name of the ShoppingList.</p> 147 * @param name value to be set 148 * @return Builder 149 */ 150 151 public ShoppingListBuilder name(final com.commercetools.api.models.common.LocalizedString name) { 152 this.name = name; 153 return this; 154 } 155 156 /** 157 * <p>User-defined unique identifier of the ShoppingList.</p> 158 * @param key value to be set 159 * @return Builder 160 */ 161 162 public ShoppingListBuilder key(@Nullable final String key) { 163 this.key = key; 164 return this; 165 } 166 167 /** 168 * <p>Reference to a Customer associated with the ShoppingList.</p> 169 * @param builder function to build the customer value 170 * @return Builder 171 */ 172 173 public ShoppingListBuilder customer( 174 Function<com.commercetools.api.models.customer.CustomerReferenceBuilder, com.commercetools.api.models.customer.CustomerReferenceBuilder> builder) { 175 this.customer = builder.apply(com.commercetools.api.models.customer.CustomerReferenceBuilder.of()).build(); 176 return this; 177 } 178 179 /** 180 * <p>Reference to a Customer associated with the ShoppingList.</p> 181 * @param builder function to build the customer value 182 * @return Builder 183 */ 184 185 public ShoppingListBuilder withCustomer( 186 Function<com.commercetools.api.models.customer.CustomerReferenceBuilder, com.commercetools.api.models.customer.CustomerReference> builder) { 187 this.customer = builder.apply(com.commercetools.api.models.customer.CustomerReferenceBuilder.of()); 188 return this; 189 } 190 191 /** 192 * <p>Reference to a Customer associated with the ShoppingList.</p> 193 * @param customer value to be set 194 * @return Builder 195 */ 196 197 public ShoppingListBuilder customer( 198 @Nullable final com.commercetools.api.models.customer.CustomerReference customer) { 199 this.customer = customer; 200 return this; 201 } 202 203 /** 204 * <p>Human-readable identifiers usually used as deep-link URL to the related ShoppingList. Each slug is unique across a Project, but a ShoppingList can have the same slug for different languages. The slug must match the pattern <code>[a-zA-Z0-9_-]{2,256}</code>. For good performance, indexes are provided for the first 15 <code>languages</code> set on the Project.</p> 205 * @param builder function to build the slug value 206 * @return Builder 207 */ 208 209 public ShoppingListBuilder slug( 210 Function<com.commercetools.api.models.common.LocalizedStringBuilder, com.commercetools.api.models.common.LocalizedStringBuilder> builder) { 211 this.slug = builder.apply(com.commercetools.api.models.common.LocalizedStringBuilder.of()).build(); 212 return this; 213 } 214 215 /** 216 * <p>Human-readable identifiers usually used as deep-link URL to the related ShoppingList. Each slug is unique across a Project, but a ShoppingList can have the same slug for different languages. The slug must match the pattern <code>[a-zA-Z0-9_-]{2,256}</code>. For good performance, indexes are provided for the first 15 <code>languages</code> set on the Project.</p> 217 * @param builder function to build the slug value 218 * @return Builder 219 */ 220 221 public ShoppingListBuilder withSlug( 222 Function<com.commercetools.api.models.common.LocalizedStringBuilder, com.commercetools.api.models.common.LocalizedString> builder) { 223 this.slug = builder.apply(com.commercetools.api.models.common.LocalizedStringBuilder.of()); 224 return this; 225 } 226 227 /** 228 * <p>Human-readable identifiers usually used as deep-link URL to the related ShoppingList. Each slug is unique across a Project, but a ShoppingList can have the same slug for different languages. The slug must match the pattern <code>[a-zA-Z0-9_-]{2,256}</code>. For good performance, indexes are provided for the first 15 <code>languages</code> set on the Project.</p> 229 * @param slug value to be set 230 * @return Builder 231 */ 232 233 public ShoppingListBuilder slug(@Nullable final com.commercetools.api.models.common.LocalizedString slug) { 234 this.slug = slug; 235 return this; 236 } 237 238 /** 239 * <p>Description of the ShoppingList.</p> 240 * @param builder function to build the description value 241 * @return Builder 242 */ 243 244 public ShoppingListBuilder description( 245 Function<com.commercetools.api.models.common.LocalizedStringBuilder, com.commercetools.api.models.common.LocalizedStringBuilder> builder) { 246 this.description = builder.apply(com.commercetools.api.models.common.LocalizedStringBuilder.of()).build(); 247 return this; 248 } 249 250 /** 251 * <p>Description of the ShoppingList.</p> 252 * @param builder function to build the description value 253 * @return Builder 254 */ 255 256 public ShoppingListBuilder withDescription( 257 Function<com.commercetools.api.models.common.LocalizedStringBuilder, com.commercetools.api.models.common.LocalizedString> builder) { 258 this.description = builder.apply(com.commercetools.api.models.common.LocalizedStringBuilder.of()); 259 return this; 260 } 261 262 /** 263 * <p>Description of the ShoppingList.</p> 264 * @param description value to be set 265 * @return Builder 266 */ 267 268 public ShoppingListBuilder description( 269 @Nullable final com.commercetools.api.models.common.LocalizedString description) { 270 this.description = description; 271 return this; 272 } 273 274 /** 275 * <p>Line Items (containing Products) of the ShoppingList.</p> 276 * @param lineItems value to be set 277 * @return Builder 278 */ 279 280 public ShoppingListBuilder lineItems( 281 final com.commercetools.api.models.shopping_list.ShoppingListLineItem... lineItems) { 282 this.lineItems = new ArrayList<>(Arrays.asList(lineItems)); 283 return this; 284 } 285 286 /** 287 * <p>Line Items (containing Products) of the ShoppingList.</p> 288 * @param lineItems value to be set 289 * @return Builder 290 */ 291 292 public ShoppingListBuilder lineItems( 293 final java.util.List<com.commercetools.api.models.shopping_list.ShoppingListLineItem> lineItems) { 294 this.lineItems = lineItems; 295 return this; 296 } 297 298 /** 299 * <p>Line Items (containing Products) of the ShoppingList.</p> 300 * @param lineItems value to be set 301 * @return Builder 302 */ 303 304 public ShoppingListBuilder plusLineItems( 305 final com.commercetools.api.models.shopping_list.ShoppingListLineItem... lineItems) { 306 if (this.lineItems == null) { 307 this.lineItems = new ArrayList<>(); 308 } 309 this.lineItems.addAll(Arrays.asList(lineItems)); 310 return this; 311 } 312 313 /** 314 * <p>Line Items (containing Products) of the ShoppingList.</p> 315 * @param builder function to build the lineItems value 316 * @return Builder 317 */ 318 319 public ShoppingListBuilder plusLineItems( 320 Function<com.commercetools.api.models.shopping_list.ShoppingListLineItemBuilder, com.commercetools.api.models.shopping_list.ShoppingListLineItemBuilder> builder) { 321 if (this.lineItems == null) { 322 this.lineItems = new ArrayList<>(); 323 } 324 this.lineItems.add( 325 builder.apply(com.commercetools.api.models.shopping_list.ShoppingListLineItemBuilder.of()).build()); 326 return this; 327 } 328 329 /** 330 * <p>Line Items (containing Products) of the ShoppingList.</p> 331 * @param builder function to build the lineItems value 332 * @return Builder 333 */ 334 335 public ShoppingListBuilder withLineItems( 336 Function<com.commercetools.api.models.shopping_list.ShoppingListLineItemBuilder, com.commercetools.api.models.shopping_list.ShoppingListLineItemBuilder> builder) { 337 this.lineItems = new ArrayList<>(); 338 this.lineItems.add( 339 builder.apply(com.commercetools.api.models.shopping_list.ShoppingListLineItemBuilder.of()).build()); 340 return this; 341 } 342 343 /** 344 * <p>Line Items (containing Products) of the ShoppingList.</p> 345 * @param builder function to build the lineItems value 346 * @return Builder 347 */ 348 349 public ShoppingListBuilder addLineItems( 350 Function<com.commercetools.api.models.shopping_list.ShoppingListLineItemBuilder, com.commercetools.api.models.shopping_list.ShoppingListLineItem> builder) { 351 return plusLineItems( 352 builder.apply(com.commercetools.api.models.shopping_list.ShoppingListLineItemBuilder.of())); 353 } 354 355 /** 356 * <p>Line Items (containing Products) of the ShoppingList.</p> 357 * @param builder function to build the lineItems value 358 * @return Builder 359 */ 360 361 public ShoppingListBuilder setLineItems( 362 Function<com.commercetools.api.models.shopping_list.ShoppingListLineItemBuilder, com.commercetools.api.models.shopping_list.ShoppingListLineItem> builder) { 363 return lineItems(builder.apply(com.commercetools.api.models.shopping_list.ShoppingListLineItemBuilder.of())); 364 } 365 366 /** 367 * <p>Line Items (containing text values) of the ShoppingList.</p> 368 * @param textLineItems value to be set 369 * @return Builder 370 */ 371 372 public ShoppingListBuilder textLineItems( 373 final com.commercetools.api.models.shopping_list.TextLineItem... textLineItems) { 374 this.textLineItems = new ArrayList<>(Arrays.asList(textLineItems)); 375 return this; 376 } 377 378 /** 379 * <p>Line Items (containing text values) of the ShoppingList.</p> 380 * @param textLineItems value to be set 381 * @return Builder 382 */ 383 384 public ShoppingListBuilder textLineItems( 385 final java.util.List<com.commercetools.api.models.shopping_list.TextLineItem> textLineItems) { 386 this.textLineItems = textLineItems; 387 return this; 388 } 389 390 /** 391 * <p>Line Items (containing text values) of the ShoppingList.</p> 392 * @param textLineItems value to be set 393 * @return Builder 394 */ 395 396 public ShoppingListBuilder plusTextLineItems( 397 final com.commercetools.api.models.shopping_list.TextLineItem... textLineItems) { 398 if (this.textLineItems == null) { 399 this.textLineItems = new ArrayList<>(); 400 } 401 this.textLineItems.addAll(Arrays.asList(textLineItems)); 402 return this; 403 } 404 405 /** 406 * <p>Line Items (containing text values) of the ShoppingList.</p> 407 * @param builder function to build the textLineItems value 408 * @return Builder 409 */ 410 411 public ShoppingListBuilder plusTextLineItems( 412 Function<com.commercetools.api.models.shopping_list.TextLineItemBuilder, com.commercetools.api.models.shopping_list.TextLineItemBuilder> builder) { 413 if (this.textLineItems == null) { 414 this.textLineItems = new ArrayList<>(); 415 } 416 this.textLineItems 417 .add(builder.apply(com.commercetools.api.models.shopping_list.TextLineItemBuilder.of()).build()); 418 return this; 419 } 420 421 /** 422 * <p>Line Items (containing text values) of the ShoppingList.</p> 423 * @param builder function to build the textLineItems value 424 * @return Builder 425 */ 426 427 public ShoppingListBuilder withTextLineItems( 428 Function<com.commercetools.api.models.shopping_list.TextLineItemBuilder, com.commercetools.api.models.shopping_list.TextLineItemBuilder> builder) { 429 this.textLineItems = new ArrayList<>(); 430 this.textLineItems 431 .add(builder.apply(com.commercetools.api.models.shopping_list.TextLineItemBuilder.of()).build()); 432 return this; 433 } 434 435 /** 436 * <p>Line Items (containing text values) of the ShoppingList.</p> 437 * @param builder function to build the textLineItems value 438 * @return Builder 439 */ 440 441 public ShoppingListBuilder addTextLineItems( 442 Function<com.commercetools.api.models.shopping_list.TextLineItemBuilder, com.commercetools.api.models.shopping_list.TextLineItem> builder) { 443 return plusTextLineItems(builder.apply(com.commercetools.api.models.shopping_list.TextLineItemBuilder.of())); 444 } 445 446 /** 447 * <p>Line Items (containing text values) of the ShoppingList.</p> 448 * @param builder function to build the textLineItems value 449 * @return Builder 450 */ 451 452 public ShoppingListBuilder setTextLineItems( 453 Function<com.commercetools.api.models.shopping_list.TextLineItemBuilder, com.commercetools.api.models.shopping_list.TextLineItem> builder) { 454 return textLineItems(builder.apply(com.commercetools.api.models.shopping_list.TextLineItemBuilder.of())); 455 } 456 457 /** 458 * <p>Number of days after which the ShoppingList will be automatically deleted if it has not been modified.</p> 459 * @param deleteDaysAfterLastModification value to be set 460 * @return Builder 461 */ 462 463 public ShoppingListBuilder deleteDaysAfterLastModification(@Nullable final Long deleteDaysAfterLastModification) { 464 this.deleteDaysAfterLastModification = deleteDaysAfterLastModification; 465 return this; 466 } 467 468 /** 469 * <p>Identifies ShoppingLists belonging to an anonymous session.</p> 470 * @param anonymousId value to be set 471 * @return Builder 472 */ 473 474 public ShoppingListBuilder anonymousId(@Nullable final String anonymousId) { 475 this.anonymousId = anonymousId; 476 return this; 477 } 478 479 /** 480 * <p>Store to which the ShoppingList is assigned.</p> 481 * @param builder function to build the store value 482 * @return Builder 483 */ 484 485 public ShoppingListBuilder store( 486 Function<com.commercetools.api.models.store.StoreKeyReferenceBuilder, com.commercetools.api.models.store.StoreKeyReferenceBuilder> builder) { 487 this.store = builder.apply(com.commercetools.api.models.store.StoreKeyReferenceBuilder.of()).build(); 488 return this; 489 } 490 491 /** 492 * <p>Store to which the ShoppingList is assigned.</p> 493 * @param builder function to build the store value 494 * @return Builder 495 */ 496 497 public ShoppingListBuilder withStore( 498 Function<com.commercetools.api.models.store.StoreKeyReferenceBuilder, com.commercetools.api.models.store.StoreKeyReference> builder) { 499 this.store = builder.apply(com.commercetools.api.models.store.StoreKeyReferenceBuilder.of()); 500 return this; 501 } 502 503 /** 504 * <p>Store to which the ShoppingList is assigned.</p> 505 * @param store value to be set 506 * @return Builder 507 */ 508 509 public ShoppingListBuilder store(@Nullable final com.commercetools.api.models.store.StoreKeyReference store) { 510 this.store = store; 511 return this; 512 } 513 514 /** 515 * <p>Custom Fields defined for the ShoppingList.</p> 516 * @param builder function to build the custom value 517 * @return Builder 518 */ 519 520 public ShoppingListBuilder custom( 521 Function<com.commercetools.api.models.type.CustomFieldsBuilder, com.commercetools.api.models.type.CustomFieldsBuilder> builder) { 522 this.custom = builder.apply(com.commercetools.api.models.type.CustomFieldsBuilder.of()).build(); 523 return this; 524 } 525 526 /** 527 * <p>Custom Fields defined for the ShoppingList.</p> 528 * @param builder function to build the custom value 529 * @return Builder 530 */ 531 532 public ShoppingListBuilder withCustom( 533 Function<com.commercetools.api.models.type.CustomFieldsBuilder, com.commercetools.api.models.type.CustomFields> builder) { 534 this.custom = builder.apply(com.commercetools.api.models.type.CustomFieldsBuilder.of()); 535 return this; 536 } 537 538 /** 539 * <p>Custom Fields defined for the ShoppingList.</p> 540 * @param custom value to be set 541 * @return Builder 542 */ 543 544 public ShoppingListBuilder custom(@Nullable final com.commercetools.api.models.type.CustomFields custom) { 545 this.custom = custom; 546 return this; 547 } 548 549 /** 550 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 551 * @param builder function to build the lastModifiedBy value 552 * @return Builder 553 */ 554 555 public ShoppingListBuilder lastModifiedBy( 556 Function<com.commercetools.api.models.common.LastModifiedByBuilder, com.commercetools.api.models.common.LastModifiedByBuilder> builder) { 557 this.lastModifiedBy = builder.apply(com.commercetools.api.models.common.LastModifiedByBuilder.of()).build(); 558 return this; 559 } 560 561 /** 562 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 563 * @param builder function to build the lastModifiedBy value 564 * @return Builder 565 */ 566 567 public ShoppingListBuilder withLastModifiedBy( 568 Function<com.commercetools.api.models.common.LastModifiedByBuilder, com.commercetools.api.models.common.LastModifiedBy> builder) { 569 this.lastModifiedBy = builder.apply(com.commercetools.api.models.common.LastModifiedByBuilder.of()); 570 return this; 571 } 572 573 /** 574 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 575 * @param lastModifiedBy value to be set 576 * @return Builder 577 */ 578 579 public ShoppingListBuilder lastModifiedBy( 580 @Nullable final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy) { 581 this.lastModifiedBy = lastModifiedBy; 582 return this; 583 } 584 585 /** 586 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 587 * @param builder function to build the createdBy value 588 * @return Builder 589 */ 590 591 public ShoppingListBuilder createdBy( 592 Function<com.commercetools.api.models.common.CreatedByBuilder, com.commercetools.api.models.common.CreatedByBuilder> builder) { 593 this.createdBy = builder.apply(com.commercetools.api.models.common.CreatedByBuilder.of()).build(); 594 return this; 595 } 596 597 /** 598 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 599 * @param builder function to build the createdBy value 600 * @return Builder 601 */ 602 603 public ShoppingListBuilder withCreatedBy( 604 Function<com.commercetools.api.models.common.CreatedByBuilder, com.commercetools.api.models.common.CreatedBy> builder) { 605 this.createdBy = builder.apply(com.commercetools.api.models.common.CreatedByBuilder.of()); 606 return this; 607 } 608 609 /** 610 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 611 * @param createdBy value to be set 612 * @return Builder 613 */ 614 615 public ShoppingListBuilder createdBy(@Nullable final com.commercetools.api.models.common.CreatedBy createdBy) { 616 this.createdBy = createdBy; 617 return this; 618 } 619 620 /** 621 * <p>Unique identifier of the ShoppingList.</p> 622 * @return id 623 */ 624 625 public String getId() { 626 return this.id; 627 } 628 629 /** 630 * <p>Current version of the ShoppingList.</p> 631 * @return version 632 */ 633 634 public Long getVersion() { 635 return this.version; 636 } 637 638 /** 639 * <p>Date and time (UTC) the ShoppingList was initially created.</p> 640 * @return createdAt 641 */ 642 643 public java.time.ZonedDateTime getCreatedAt() { 644 return this.createdAt; 645 } 646 647 /** 648 * <p>Date and time (UTC) the ShoppingList was last updated.</p> 649 * @return lastModifiedAt 650 */ 651 652 public java.time.ZonedDateTime getLastModifiedAt() { 653 return this.lastModifiedAt; 654 } 655 656 /** 657 * <p>Name of the ShoppingList.</p> 658 * @return name 659 */ 660 661 public com.commercetools.api.models.common.LocalizedString getName() { 662 return this.name; 663 } 664 665 /** 666 * <p>User-defined unique identifier of the ShoppingList.</p> 667 * @return key 668 */ 669 670 @Nullable 671 public String getKey() { 672 return this.key; 673 } 674 675 /** 676 * <p>Reference to a Customer associated with the ShoppingList.</p> 677 * @return customer 678 */ 679 680 @Nullable 681 public com.commercetools.api.models.customer.CustomerReference getCustomer() { 682 return this.customer; 683 } 684 685 /** 686 * <p>Human-readable identifiers usually used as deep-link URL to the related ShoppingList. Each slug is unique across a Project, but a ShoppingList can have the same slug for different languages. The slug must match the pattern <code>[a-zA-Z0-9_-]{2,256}</code>. For good performance, indexes are provided for the first 15 <code>languages</code> set on the Project.</p> 687 * @return slug 688 */ 689 690 @Nullable 691 public com.commercetools.api.models.common.LocalizedString getSlug() { 692 return this.slug; 693 } 694 695 /** 696 * <p>Description of the ShoppingList.</p> 697 * @return description 698 */ 699 700 @Nullable 701 public com.commercetools.api.models.common.LocalizedString getDescription() { 702 return this.description; 703 } 704 705 /** 706 * <p>Line Items (containing Products) of the ShoppingList.</p> 707 * @return lineItems 708 */ 709 710 public java.util.List<com.commercetools.api.models.shopping_list.ShoppingListLineItem> getLineItems() { 711 return this.lineItems; 712 } 713 714 /** 715 * <p>Line Items (containing text values) of the ShoppingList.</p> 716 * @return textLineItems 717 */ 718 719 public java.util.List<com.commercetools.api.models.shopping_list.TextLineItem> getTextLineItems() { 720 return this.textLineItems; 721 } 722 723 /** 724 * <p>Number of days after which the ShoppingList will be automatically deleted if it has not been modified.</p> 725 * @return deleteDaysAfterLastModification 726 */ 727 728 @Nullable 729 public Long getDeleteDaysAfterLastModification() { 730 return this.deleteDaysAfterLastModification; 731 } 732 733 /** 734 * <p>Identifies ShoppingLists belonging to an anonymous session.</p> 735 * @return anonymousId 736 */ 737 738 @Nullable 739 public String getAnonymousId() { 740 return this.anonymousId; 741 } 742 743 /** 744 * <p>Store to which the ShoppingList is assigned.</p> 745 * @return store 746 */ 747 748 @Nullable 749 public com.commercetools.api.models.store.StoreKeyReference getStore() { 750 return this.store; 751 } 752 753 /** 754 * <p>Custom Fields defined for the ShoppingList.</p> 755 * @return custom 756 */ 757 758 @Nullable 759 public com.commercetools.api.models.type.CustomFields getCustom() { 760 return this.custom; 761 } 762 763 /** 764 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 765 * @return lastModifiedBy 766 */ 767 768 @Nullable 769 public com.commercetools.api.models.common.LastModifiedBy getLastModifiedBy() { 770 return this.lastModifiedBy; 771 } 772 773 /** 774 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 775 * @return createdBy 776 */ 777 778 @Nullable 779 public com.commercetools.api.models.common.CreatedBy getCreatedBy() { 780 return this.createdBy; 781 } 782 783 /** 784 * builds ShoppingList with checking for non-null required values 785 * @return ShoppingList 786 */ 787 public ShoppingList build() { 788 Objects.requireNonNull(id, ShoppingList.class + ": id is missing"); 789 Objects.requireNonNull(version, ShoppingList.class + ": version is missing"); 790 Objects.requireNonNull(createdAt, ShoppingList.class + ": createdAt is missing"); 791 Objects.requireNonNull(lastModifiedAt, ShoppingList.class + ": lastModifiedAt is missing"); 792 Objects.requireNonNull(name, ShoppingList.class + ": name is missing"); 793 Objects.requireNonNull(lineItems, ShoppingList.class + ": lineItems is missing"); 794 Objects.requireNonNull(textLineItems, ShoppingList.class + ": textLineItems is missing"); 795 return new ShoppingListImpl(id, version, createdAt, lastModifiedAt, name, key, customer, slug, description, 796 lineItems, textLineItems, deleteDaysAfterLastModification, anonymousId, store, custom, lastModifiedBy, 797 createdBy); 798 } 799 800 /** 801 * builds ShoppingList without checking for non-null required values 802 * @return ShoppingList 803 */ 804 public ShoppingList buildUnchecked() { 805 return new ShoppingListImpl(id, version, createdAt, lastModifiedAt, name, key, customer, slug, description, 806 lineItems, textLineItems, deleteDaysAfterLastModification, anonymousId, store, custom, lastModifiedBy, 807 createdBy); 808 } 809 810 /** 811 * factory method for an instance of ShoppingListBuilder 812 * @return builder 813 */ 814 public static ShoppingListBuilder of() { 815 return new ShoppingListBuilder(); 816 } 817 818 /** 819 * create builder for ShoppingList instance 820 * @param template instance with prefilled values for the builder 821 * @return builder 822 */ 823 public static ShoppingListBuilder of(final ShoppingList template) { 824 ShoppingListBuilder builder = new ShoppingListBuilder(); 825 builder.id = template.getId(); 826 builder.version = template.getVersion(); 827 builder.createdAt = template.getCreatedAt(); 828 builder.lastModifiedAt = template.getLastModifiedAt(); 829 builder.name = template.getName(); 830 builder.key = template.getKey(); 831 builder.customer = template.getCustomer(); 832 builder.slug = template.getSlug(); 833 builder.description = template.getDescription(); 834 builder.lineItems = template.getLineItems(); 835 builder.textLineItems = template.getTextLineItems(); 836 builder.deleteDaysAfterLastModification = template.getDeleteDaysAfterLastModification(); 837 builder.anonymousId = template.getAnonymousId(); 838 builder.store = template.getStore(); 839 builder.custom = template.getCustom(); 840 builder.lastModifiedBy = template.getLastModifiedBy(); 841 builder.createdBy = template.getCreatedBy(); 842 return builder; 843 } 844 845}