001 002package com.commercetools.api.models.category; 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 * CategoryBuilder 014 * <hr> 015 * Example to create an instance using the builder pattern 016 * <div class=code-example> 017 * <pre><code class='java'> 018 * Category category = Category.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 * .slug(slugBuilder -> slugBuilder) 025 * .plusAncestors(ancestorsBuilder -> ancestorsBuilder) 026 * .orderHint("{orderHint}") 027 * .build() 028 * </code></pre> 029 * </div> 030 */ 031@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 032public class CategoryBuilder implements Builder<Category> { 033 034 private String id; 035 036 private Long version; 037 038 private java.time.ZonedDateTime createdAt; 039 040 private java.time.ZonedDateTime lastModifiedAt; 041 042 @Nullable 043 private com.commercetools.api.models.common.LastModifiedBy lastModifiedBy; 044 045 @Nullable 046 private com.commercetools.api.models.common.CreatedBy createdBy; 047 048 private com.commercetools.api.models.common.LocalizedString name; 049 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.category.CategoryReference> ancestors; 056 057 @Nullable 058 private com.commercetools.api.models.category.CategoryReference parent; 059 060 private String orderHint; 061 062 @Nullable 063 private String externalId; 064 065 @Nullable 066 private com.commercetools.api.models.common.LocalizedString metaTitle; 067 068 @Nullable 069 private com.commercetools.api.models.common.LocalizedString metaDescription; 070 071 @Nullable 072 private com.commercetools.api.models.common.LocalizedString metaKeywords; 073 074 @Nullable 075 private com.commercetools.api.models.type.CustomFields custom; 076 077 @Nullable 078 private java.util.List<com.commercetools.api.models.common.Asset> assets; 079 080 @Nullable 081 private String key; 082 083 /** 084 * <p>Unique identifier of the Category.</p> 085 * @param id value to be set 086 * @return Builder 087 */ 088 089 public CategoryBuilder id(final String id) { 090 this.id = id; 091 return this; 092 } 093 094 /** 095 * <p>Current version of the Category.</p> 096 * @param version value to be set 097 * @return Builder 098 */ 099 100 public CategoryBuilder version(final Long version) { 101 this.version = version; 102 return this; 103 } 104 105 /** 106 * <p>Date and time (UTC) the Category was initially created.</p> 107 * @param createdAt value to be set 108 * @return Builder 109 */ 110 111 public CategoryBuilder createdAt(final java.time.ZonedDateTime createdAt) { 112 this.createdAt = createdAt; 113 return this; 114 } 115 116 /** 117 * <p>Date and time (UTC) the Category was last updated.</p> 118 * @param lastModifiedAt value to be set 119 * @return Builder 120 */ 121 122 public CategoryBuilder lastModifiedAt(final java.time.ZonedDateTime lastModifiedAt) { 123 this.lastModifiedAt = lastModifiedAt; 124 return this; 125 } 126 127 /** 128 * <p>Present on resources updated after 1 February 2019 except for events not tracked.</p> 129 * @param builder function to build the lastModifiedBy value 130 * @return Builder 131 */ 132 133 public CategoryBuilder lastModifiedBy( 134 Function<com.commercetools.api.models.common.LastModifiedByBuilder, com.commercetools.api.models.common.LastModifiedByBuilder> builder) { 135 this.lastModifiedBy = builder.apply(com.commercetools.api.models.common.LastModifiedByBuilder.of()).build(); 136 return this; 137 } 138 139 /** 140 * <p>Present on resources updated after 1 February 2019 except for events not tracked.</p> 141 * @param builder function to build the lastModifiedBy value 142 * @return Builder 143 */ 144 145 public CategoryBuilder withLastModifiedBy( 146 Function<com.commercetools.api.models.common.LastModifiedByBuilder, com.commercetools.api.models.common.LastModifiedBy> builder) { 147 this.lastModifiedBy = builder.apply(com.commercetools.api.models.common.LastModifiedByBuilder.of()); 148 return this; 149 } 150 151 /** 152 * <p>Present on resources updated after 1 February 2019 except for events not tracked.</p> 153 * @param lastModifiedBy value to be set 154 * @return Builder 155 */ 156 157 public CategoryBuilder lastModifiedBy( 158 @Nullable final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy) { 159 this.lastModifiedBy = lastModifiedBy; 160 return this; 161 } 162 163 /** 164 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 165 * @param builder function to build the createdBy value 166 * @return Builder 167 */ 168 169 public CategoryBuilder createdBy( 170 Function<com.commercetools.api.models.common.CreatedByBuilder, com.commercetools.api.models.common.CreatedByBuilder> builder) { 171 this.createdBy = builder.apply(com.commercetools.api.models.common.CreatedByBuilder.of()).build(); 172 return this; 173 } 174 175 /** 176 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 177 * @param builder function to build the createdBy value 178 * @return Builder 179 */ 180 181 public CategoryBuilder withCreatedBy( 182 Function<com.commercetools.api.models.common.CreatedByBuilder, com.commercetools.api.models.common.CreatedBy> builder) { 183 this.createdBy = builder.apply(com.commercetools.api.models.common.CreatedByBuilder.of()); 184 return this; 185 } 186 187 /** 188 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 189 * @param createdBy value to be set 190 * @return Builder 191 */ 192 193 public CategoryBuilder createdBy(@Nullable final com.commercetools.api.models.common.CreatedBy createdBy) { 194 this.createdBy = createdBy; 195 return this; 196 } 197 198 /** 199 * <p>Name of the Category.</p> 200 * @param builder function to build the name value 201 * @return Builder 202 */ 203 204 public CategoryBuilder name( 205 Function<com.commercetools.api.models.common.LocalizedStringBuilder, com.commercetools.api.models.common.LocalizedStringBuilder> builder) { 206 this.name = builder.apply(com.commercetools.api.models.common.LocalizedStringBuilder.of()).build(); 207 return this; 208 } 209 210 /** 211 * <p>Name of the Category.</p> 212 * @param builder function to build the name value 213 * @return Builder 214 */ 215 216 public CategoryBuilder withName( 217 Function<com.commercetools.api.models.common.LocalizedStringBuilder, com.commercetools.api.models.common.LocalizedString> builder) { 218 this.name = builder.apply(com.commercetools.api.models.common.LocalizedStringBuilder.of()); 219 return this; 220 } 221 222 /** 223 * <p>Name of the Category.</p> 224 * @param name value to be set 225 * @return Builder 226 */ 227 228 public CategoryBuilder name(final com.commercetools.api.models.common.LocalizedString name) { 229 this.name = name; 230 return this; 231 } 232 233 /** 234 * <p>User-defined identifier used as a deep-link URL to the related Category per Locale. A Category can have the same slug for different Locales, but they are unique across the Project. Valid slugs 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 in a Project.</p> 235 * @param builder function to build the slug value 236 * @return Builder 237 */ 238 239 public CategoryBuilder slug( 240 Function<com.commercetools.api.models.common.LocalizedStringBuilder, com.commercetools.api.models.common.LocalizedStringBuilder> builder) { 241 this.slug = builder.apply(com.commercetools.api.models.common.LocalizedStringBuilder.of()).build(); 242 return this; 243 } 244 245 /** 246 * <p>User-defined identifier used as a deep-link URL to the related Category per Locale. A Category can have the same slug for different Locales, but they are unique across the Project. Valid slugs 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 in a Project.</p> 247 * @param builder function to build the slug value 248 * @return Builder 249 */ 250 251 public CategoryBuilder withSlug( 252 Function<com.commercetools.api.models.common.LocalizedStringBuilder, com.commercetools.api.models.common.LocalizedString> builder) { 253 this.slug = builder.apply(com.commercetools.api.models.common.LocalizedStringBuilder.of()); 254 return this; 255 } 256 257 /** 258 * <p>User-defined identifier used as a deep-link URL to the related Category per Locale. A Category can have the same slug for different Locales, but they are unique across the Project. Valid slugs 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 in a Project.</p> 259 * @param slug value to be set 260 * @return Builder 261 */ 262 263 public CategoryBuilder slug(final com.commercetools.api.models.common.LocalizedString slug) { 264 this.slug = slug; 265 return this; 266 } 267 268 /** 269 * <p>Description of the Category.</p> 270 * @param builder function to build the description value 271 * @return Builder 272 */ 273 274 public CategoryBuilder description( 275 Function<com.commercetools.api.models.common.LocalizedStringBuilder, com.commercetools.api.models.common.LocalizedStringBuilder> builder) { 276 this.description = builder.apply(com.commercetools.api.models.common.LocalizedStringBuilder.of()).build(); 277 return this; 278 } 279 280 /** 281 * <p>Description of the Category.</p> 282 * @param builder function to build the description value 283 * @return Builder 284 */ 285 286 public CategoryBuilder withDescription( 287 Function<com.commercetools.api.models.common.LocalizedStringBuilder, com.commercetools.api.models.common.LocalizedString> builder) { 288 this.description = builder.apply(com.commercetools.api.models.common.LocalizedStringBuilder.of()); 289 return this; 290 } 291 292 /** 293 * <p>Description of the Category.</p> 294 * @param description value to be set 295 * @return Builder 296 */ 297 298 public CategoryBuilder description( 299 @Nullable final com.commercetools.api.models.common.LocalizedString description) { 300 this.description = description; 301 return this; 302 } 303 304 /** 305 * <p>Contains the parent path towards the root Category.</p> 306 * @param ancestors value to be set 307 * @return Builder 308 */ 309 310 public CategoryBuilder ancestors(final com.commercetools.api.models.category.CategoryReference... ancestors) { 311 this.ancestors = new ArrayList<>(Arrays.asList(ancestors)); 312 return this; 313 } 314 315 /** 316 * <p>Contains the parent path towards the root Category.</p> 317 * @param ancestors value to be set 318 * @return Builder 319 */ 320 321 public CategoryBuilder ancestors( 322 final java.util.List<com.commercetools.api.models.category.CategoryReference> ancestors) { 323 this.ancestors = ancestors; 324 return this; 325 } 326 327 /** 328 * <p>Contains the parent path towards the root Category.</p> 329 * @param ancestors value to be set 330 * @return Builder 331 */ 332 333 public CategoryBuilder plusAncestors(final com.commercetools.api.models.category.CategoryReference... ancestors) { 334 if (this.ancestors == null) { 335 this.ancestors = new ArrayList<>(); 336 } 337 this.ancestors.addAll(Arrays.asList(ancestors)); 338 return this; 339 } 340 341 /** 342 * <p>Contains the parent path towards the root Category.</p> 343 * @param builder function to build the ancestors value 344 * @return Builder 345 */ 346 347 public CategoryBuilder plusAncestors( 348 Function<com.commercetools.api.models.category.CategoryReferenceBuilder, com.commercetools.api.models.category.CategoryReferenceBuilder> builder) { 349 if (this.ancestors == null) { 350 this.ancestors = new ArrayList<>(); 351 } 352 this.ancestors.add(builder.apply(com.commercetools.api.models.category.CategoryReferenceBuilder.of()).build()); 353 return this; 354 } 355 356 /** 357 * <p>Contains the parent path towards the root Category.</p> 358 * @param builder function to build the ancestors value 359 * @return Builder 360 */ 361 362 public CategoryBuilder withAncestors( 363 Function<com.commercetools.api.models.category.CategoryReferenceBuilder, com.commercetools.api.models.category.CategoryReferenceBuilder> builder) { 364 this.ancestors = new ArrayList<>(); 365 this.ancestors.add(builder.apply(com.commercetools.api.models.category.CategoryReferenceBuilder.of()).build()); 366 return this; 367 } 368 369 /** 370 * <p>Contains the parent path towards the root Category.</p> 371 * @param builder function to build the ancestors value 372 * @return Builder 373 */ 374 375 public CategoryBuilder addAncestors( 376 Function<com.commercetools.api.models.category.CategoryReferenceBuilder, com.commercetools.api.models.category.CategoryReference> builder) { 377 return plusAncestors(builder.apply(com.commercetools.api.models.category.CategoryReferenceBuilder.of())); 378 } 379 380 /** 381 * <p>Contains the parent path towards the root Category.</p> 382 * @param builder function to build the ancestors value 383 * @return Builder 384 */ 385 386 public CategoryBuilder setAncestors( 387 Function<com.commercetools.api.models.category.CategoryReferenceBuilder, com.commercetools.api.models.category.CategoryReference> builder) { 388 return ancestors(builder.apply(com.commercetools.api.models.category.CategoryReferenceBuilder.of())); 389 } 390 391 /** 392 * <p>Parent Category of this Category.</p> 393 * @param builder function to build the parent value 394 * @return Builder 395 */ 396 397 public CategoryBuilder parent( 398 Function<com.commercetools.api.models.category.CategoryReferenceBuilder, com.commercetools.api.models.category.CategoryReferenceBuilder> builder) { 399 this.parent = builder.apply(com.commercetools.api.models.category.CategoryReferenceBuilder.of()).build(); 400 return this; 401 } 402 403 /** 404 * <p>Parent Category of this Category.</p> 405 * @param builder function to build the parent value 406 * @return Builder 407 */ 408 409 public CategoryBuilder withParent( 410 Function<com.commercetools.api.models.category.CategoryReferenceBuilder, com.commercetools.api.models.category.CategoryReference> builder) { 411 this.parent = builder.apply(com.commercetools.api.models.category.CategoryReferenceBuilder.of()); 412 return this; 413 } 414 415 /** 416 * <p>Parent Category of this Category.</p> 417 * @param parent value to be set 418 * @return Builder 419 */ 420 421 public CategoryBuilder parent(@Nullable final com.commercetools.api.models.category.CategoryReference parent) { 422 this.parent = parent; 423 return this; 424 } 425 426 /** 427 * <p>Decimal value between 0 and 1 used to order Categories that are on the same level in the Category tree.</p> 428 * @param orderHint value to be set 429 * @return Builder 430 */ 431 432 public CategoryBuilder orderHint(final String orderHint) { 433 this.orderHint = orderHint; 434 return this; 435 } 436 437 /** 438 * <p>Additional identifier for external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).</p> 439 * @param externalId value to be set 440 * @return Builder 441 */ 442 443 public CategoryBuilder externalId(@Nullable final String externalId) { 444 this.externalId = externalId; 445 return this; 446 } 447 448 /** 449 * <p>Name of the Category used by external search engines for improved search engine performance.</p> 450 * @param builder function to build the metaTitle value 451 * @return Builder 452 */ 453 454 public CategoryBuilder metaTitle( 455 Function<com.commercetools.api.models.common.LocalizedStringBuilder, com.commercetools.api.models.common.LocalizedStringBuilder> builder) { 456 this.metaTitle = builder.apply(com.commercetools.api.models.common.LocalizedStringBuilder.of()).build(); 457 return this; 458 } 459 460 /** 461 * <p>Name of the Category used by external search engines for improved search engine performance.</p> 462 * @param builder function to build the metaTitle value 463 * @return Builder 464 */ 465 466 public CategoryBuilder withMetaTitle( 467 Function<com.commercetools.api.models.common.LocalizedStringBuilder, com.commercetools.api.models.common.LocalizedString> builder) { 468 this.metaTitle = builder.apply(com.commercetools.api.models.common.LocalizedStringBuilder.of()); 469 return this; 470 } 471 472 /** 473 * <p>Name of the Category used by external search engines for improved search engine performance.</p> 474 * @param metaTitle value to be set 475 * @return Builder 476 */ 477 478 public CategoryBuilder metaTitle(@Nullable final com.commercetools.api.models.common.LocalizedString metaTitle) { 479 this.metaTitle = metaTitle; 480 return this; 481 } 482 483 /** 484 * <p>Description of the Category used by external search engines for improved search engine performance.</p> 485 * @param builder function to build the metaDescription value 486 * @return Builder 487 */ 488 489 public CategoryBuilder metaDescription( 490 Function<com.commercetools.api.models.common.LocalizedStringBuilder, com.commercetools.api.models.common.LocalizedStringBuilder> builder) { 491 this.metaDescription = builder.apply(com.commercetools.api.models.common.LocalizedStringBuilder.of()).build(); 492 return this; 493 } 494 495 /** 496 * <p>Description of the Category used by external search engines for improved search engine performance.</p> 497 * @param builder function to build the metaDescription value 498 * @return Builder 499 */ 500 501 public CategoryBuilder withMetaDescription( 502 Function<com.commercetools.api.models.common.LocalizedStringBuilder, com.commercetools.api.models.common.LocalizedString> builder) { 503 this.metaDescription = builder.apply(com.commercetools.api.models.common.LocalizedStringBuilder.of()); 504 return this; 505 } 506 507 /** 508 * <p>Description of the Category used by external search engines for improved search engine performance.</p> 509 * @param metaDescription value to be set 510 * @return Builder 511 */ 512 513 public CategoryBuilder metaDescription( 514 @Nullable final com.commercetools.api.models.common.LocalizedString metaDescription) { 515 this.metaDescription = metaDescription; 516 return this; 517 } 518 519 /** 520 * <p>Keywords related to the Category for improved search engine performance.</p> 521 * @param builder function to build the metaKeywords value 522 * @return Builder 523 */ 524 525 public CategoryBuilder metaKeywords( 526 Function<com.commercetools.api.models.common.LocalizedStringBuilder, com.commercetools.api.models.common.LocalizedStringBuilder> builder) { 527 this.metaKeywords = builder.apply(com.commercetools.api.models.common.LocalizedStringBuilder.of()).build(); 528 return this; 529 } 530 531 /** 532 * <p>Keywords related to the Category for improved search engine performance.</p> 533 * @param builder function to build the metaKeywords value 534 * @return Builder 535 */ 536 537 public CategoryBuilder withMetaKeywords( 538 Function<com.commercetools.api.models.common.LocalizedStringBuilder, com.commercetools.api.models.common.LocalizedString> builder) { 539 this.metaKeywords = builder.apply(com.commercetools.api.models.common.LocalizedStringBuilder.of()); 540 return this; 541 } 542 543 /** 544 * <p>Keywords related to the Category for improved search engine performance.</p> 545 * @param metaKeywords value to be set 546 * @return Builder 547 */ 548 549 public CategoryBuilder metaKeywords( 550 @Nullable final com.commercetools.api.models.common.LocalizedString metaKeywords) { 551 this.metaKeywords = metaKeywords; 552 return this; 553 } 554 555 /** 556 * <p>Custom Fields for the Category.</p> 557 * @param builder function to build the custom value 558 * @return Builder 559 */ 560 561 public CategoryBuilder custom( 562 Function<com.commercetools.api.models.type.CustomFieldsBuilder, com.commercetools.api.models.type.CustomFieldsBuilder> builder) { 563 this.custom = builder.apply(com.commercetools.api.models.type.CustomFieldsBuilder.of()).build(); 564 return this; 565 } 566 567 /** 568 * <p>Custom Fields for the Category.</p> 569 * @param builder function to build the custom value 570 * @return Builder 571 */ 572 573 public CategoryBuilder withCustom( 574 Function<com.commercetools.api.models.type.CustomFieldsBuilder, com.commercetools.api.models.type.CustomFields> builder) { 575 this.custom = builder.apply(com.commercetools.api.models.type.CustomFieldsBuilder.of()); 576 return this; 577 } 578 579 /** 580 * <p>Custom Fields for the Category.</p> 581 * @param custom value to be set 582 * @return Builder 583 */ 584 585 public CategoryBuilder custom(@Nullable final com.commercetools.api.models.type.CustomFields custom) { 586 this.custom = custom; 587 return this; 588 } 589 590 /** 591 * <p>Media related to the Category.</p> 592 * @param assets value to be set 593 * @return Builder 594 */ 595 596 public CategoryBuilder assets(@Nullable final com.commercetools.api.models.common.Asset... assets) { 597 this.assets = new ArrayList<>(Arrays.asList(assets)); 598 return this; 599 } 600 601 /** 602 * <p>Media related to the Category.</p> 603 * @param assets value to be set 604 * @return Builder 605 */ 606 607 public CategoryBuilder assets(@Nullable final java.util.List<com.commercetools.api.models.common.Asset> assets) { 608 this.assets = assets; 609 return this; 610 } 611 612 /** 613 * <p>Media related to the Category.</p> 614 * @param assets value to be set 615 * @return Builder 616 */ 617 618 public CategoryBuilder plusAssets(@Nullable final com.commercetools.api.models.common.Asset... assets) { 619 if (this.assets == null) { 620 this.assets = new ArrayList<>(); 621 } 622 this.assets.addAll(Arrays.asList(assets)); 623 return this; 624 } 625 626 /** 627 * <p>Media related to the Category.</p> 628 * @param builder function to build the assets value 629 * @return Builder 630 */ 631 632 public CategoryBuilder plusAssets( 633 Function<com.commercetools.api.models.common.AssetBuilder, com.commercetools.api.models.common.AssetBuilder> builder) { 634 if (this.assets == null) { 635 this.assets = new ArrayList<>(); 636 } 637 this.assets.add(builder.apply(com.commercetools.api.models.common.AssetBuilder.of()).build()); 638 return this; 639 } 640 641 /** 642 * <p>Media related to the Category.</p> 643 * @param builder function to build the assets value 644 * @return Builder 645 */ 646 647 public CategoryBuilder withAssets( 648 Function<com.commercetools.api.models.common.AssetBuilder, com.commercetools.api.models.common.AssetBuilder> builder) { 649 this.assets = new ArrayList<>(); 650 this.assets.add(builder.apply(com.commercetools.api.models.common.AssetBuilder.of()).build()); 651 return this; 652 } 653 654 /** 655 * <p>Media related to the Category.</p> 656 * @param builder function to build the assets value 657 * @return Builder 658 */ 659 660 public CategoryBuilder addAssets( 661 Function<com.commercetools.api.models.common.AssetBuilder, com.commercetools.api.models.common.Asset> builder) { 662 return plusAssets(builder.apply(com.commercetools.api.models.common.AssetBuilder.of())); 663 } 664 665 /** 666 * <p>Media related to the Category.</p> 667 * @param builder function to build the assets value 668 * @return Builder 669 */ 670 671 public CategoryBuilder setAssets( 672 Function<com.commercetools.api.models.common.AssetBuilder, com.commercetools.api.models.common.Asset> builder) { 673 return assets(builder.apply(com.commercetools.api.models.common.AssetBuilder.of())); 674 } 675 676 /** 677 * <p>User-defined unique identifier of the Category.</p> 678 * @param key value to be set 679 * @return Builder 680 */ 681 682 public CategoryBuilder key(@Nullable final String key) { 683 this.key = key; 684 return this; 685 } 686 687 /** 688 * <p>Unique identifier of the Category.</p> 689 * @return id 690 */ 691 692 public String getId() { 693 return this.id; 694 } 695 696 /** 697 * <p>Current version of the Category.</p> 698 * @return version 699 */ 700 701 public Long getVersion() { 702 return this.version; 703 } 704 705 /** 706 * <p>Date and time (UTC) the Category was initially created.</p> 707 * @return createdAt 708 */ 709 710 public java.time.ZonedDateTime getCreatedAt() { 711 return this.createdAt; 712 } 713 714 /** 715 * <p>Date and time (UTC) the Category was last updated.</p> 716 * @return lastModifiedAt 717 */ 718 719 public java.time.ZonedDateTime getLastModifiedAt() { 720 return this.lastModifiedAt; 721 } 722 723 /** 724 * <p>Present on resources updated after 1 February 2019 except for events not tracked.</p> 725 * @return lastModifiedBy 726 */ 727 728 @Nullable 729 public com.commercetools.api.models.common.LastModifiedBy getLastModifiedBy() { 730 return this.lastModifiedBy; 731 } 732 733 /** 734 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 735 * @return createdBy 736 */ 737 738 @Nullable 739 public com.commercetools.api.models.common.CreatedBy getCreatedBy() { 740 return this.createdBy; 741 } 742 743 /** 744 * <p>Name of the Category.</p> 745 * @return name 746 */ 747 748 public com.commercetools.api.models.common.LocalizedString getName() { 749 return this.name; 750 } 751 752 /** 753 * <p>User-defined identifier used as a deep-link URL to the related Category per Locale. A Category can have the same slug for different Locales, but they are unique across the Project. Valid slugs 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 in a Project.</p> 754 * @return slug 755 */ 756 757 public com.commercetools.api.models.common.LocalizedString getSlug() { 758 return this.slug; 759 } 760 761 /** 762 * <p>Description of the Category.</p> 763 * @return description 764 */ 765 766 @Nullable 767 public com.commercetools.api.models.common.LocalizedString getDescription() { 768 return this.description; 769 } 770 771 /** 772 * <p>Contains the parent path towards the root Category.</p> 773 * @return ancestors 774 */ 775 776 public java.util.List<com.commercetools.api.models.category.CategoryReference> getAncestors() { 777 return this.ancestors; 778 } 779 780 /** 781 * <p>Parent Category of this Category.</p> 782 * @return parent 783 */ 784 785 @Nullable 786 public com.commercetools.api.models.category.CategoryReference getParent() { 787 return this.parent; 788 } 789 790 /** 791 * <p>Decimal value between 0 and 1 used to order Categories that are on the same level in the Category tree.</p> 792 * @return orderHint 793 */ 794 795 public String getOrderHint() { 796 return this.orderHint; 797 } 798 799 /** 800 * <p>Additional identifier for external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).</p> 801 * @return externalId 802 */ 803 804 @Nullable 805 public String getExternalId() { 806 return this.externalId; 807 } 808 809 /** 810 * <p>Name of the Category used by external search engines for improved search engine performance.</p> 811 * @return metaTitle 812 */ 813 814 @Nullable 815 public com.commercetools.api.models.common.LocalizedString getMetaTitle() { 816 return this.metaTitle; 817 } 818 819 /** 820 * <p>Description of the Category used by external search engines for improved search engine performance.</p> 821 * @return metaDescription 822 */ 823 824 @Nullable 825 public com.commercetools.api.models.common.LocalizedString getMetaDescription() { 826 return this.metaDescription; 827 } 828 829 /** 830 * <p>Keywords related to the Category for improved search engine performance.</p> 831 * @return metaKeywords 832 */ 833 834 @Nullable 835 public com.commercetools.api.models.common.LocalizedString getMetaKeywords() { 836 return this.metaKeywords; 837 } 838 839 /** 840 * <p>Custom Fields for the Category.</p> 841 * @return custom 842 */ 843 844 @Nullable 845 public com.commercetools.api.models.type.CustomFields getCustom() { 846 return this.custom; 847 } 848 849 /** 850 * <p>Media related to the Category.</p> 851 * @return assets 852 */ 853 854 @Nullable 855 public java.util.List<com.commercetools.api.models.common.Asset> getAssets() { 856 return this.assets; 857 } 858 859 /** 860 * <p>User-defined unique identifier of the Category.</p> 861 * @return key 862 */ 863 864 @Nullable 865 public String getKey() { 866 return this.key; 867 } 868 869 /** 870 * builds Category with checking for non-null required values 871 * @return Category 872 */ 873 public Category build() { 874 Objects.requireNonNull(id, Category.class + ": id is missing"); 875 Objects.requireNonNull(version, Category.class + ": version is missing"); 876 Objects.requireNonNull(createdAt, Category.class + ": createdAt is missing"); 877 Objects.requireNonNull(lastModifiedAt, Category.class + ": lastModifiedAt is missing"); 878 Objects.requireNonNull(name, Category.class + ": name is missing"); 879 Objects.requireNonNull(slug, Category.class + ": slug is missing"); 880 Objects.requireNonNull(ancestors, Category.class + ": ancestors is missing"); 881 Objects.requireNonNull(orderHint, Category.class + ": orderHint is missing"); 882 return new CategoryImpl(id, version, createdAt, lastModifiedAt, lastModifiedBy, createdBy, name, slug, 883 description, ancestors, parent, orderHint, externalId, metaTitle, metaDescription, metaKeywords, custom, 884 assets, key); 885 } 886 887 /** 888 * builds Category without checking for non-null required values 889 * @return Category 890 */ 891 public Category buildUnchecked() { 892 return new CategoryImpl(id, version, createdAt, lastModifiedAt, lastModifiedBy, createdBy, name, slug, 893 description, ancestors, parent, orderHint, externalId, metaTitle, metaDescription, metaKeywords, custom, 894 assets, key); 895 } 896 897 /** 898 * factory method for an instance of CategoryBuilder 899 * @return builder 900 */ 901 public static CategoryBuilder of() { 902 return new CategoryBuilder(); 903 } 904 905 /** 906 * create builder for Category instance 907 * @param template instance with prefilled values for the builder 908 * @return builder 909 */ 910 public static CategoryBuilder of(final Category template) { 911 CategoryBuilder builder = new CategoryBuilder(); 912 builder.id = template.getId(); 913 builder.version = template.getVersion(); 914 builder.createdAt = template.getCreatedAt(); 915 builder.lastModifiedAt = template.getLastModifiedAt(); 916 builder.lastModifiedBy = template.getLastModifiedBy(); 917 builder.createdBy = template.getCreatedBy(); 918 builder.name = template.getName(); 919 builder.slug = template.getSlug(); 920 builder.description = template.getDescription(); 921 builder.ancestors = template.getAncestors(); 922 builder.parent = template.getParent(); 923 builder.orderHint = template.getOrderHint(); 924 builder.externalId = template.getExternalId(); 925 builder.metaTitle = template.getMetaTitle(); 926 builder.metaDescription = template.getMetaDescription(); 927 builder.metaKeywords = template.getMetaKeywords(); 928 builder.custom = template.getCustom(); 929 builder.assets = template.getAssets(); 930 builder.key = template.getKey(); 931 return builder; 932 } 933 934}