Class ProductTypeBuilder

java.lang.Object
com.commercetools.api.models.product_type.ProductTypeBuilder
All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<ProductType>

public class ProductTypeBuilder extends Object implements io.vrap.rmf.base.client.Builder<ProductType>
ProductTypeBuilder
Example to create an instance using the builder pattern

     ProductType productType = ProductType.builder()
             .id("{id}")
             .version(0.3)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .name("{name}")
             .description("{description}")
             .build()
 
  • Constructor Details

    • ProductTypeBuilder

      public ProductTypeBuilder()
  • Method Details

    • id

      public ProductTypeBuilder id(String id)

      Unique identifier of the ProductType.

      Parameters:
      id - value to be set
      Returns:
      Builder
    • version

      public ProductTypeBuilder version(Long version)

      Current version of the ProductType.

      Parameters:
      version - value to be set
      Returns:
      Builder
    • createdAt

      public ProductTypeBuilder createdAt(ZonedDateTime createdAt)

      Date and time (UTC) the ProductType was initially created.

      Parameters:
      createdAt - value to be set
      Returns:
      Builder
    • lastModifiedAt

      public ProductTypeBuilder lastModifiedAt(ZonedDateTime lastModifiedAt)

      Date and time (UTC) the ProductType was last updated.

      Parameters:
      lastModifiedAt - value to be set
      Returns:
      Builder
    • lastModifiedBy

      Present on resources created after 1 February 2019 except for events not tracked.

      Parameters:
      builder - function to build the lastModifiedBy value
      Returns:
      Builder
    • withLastModifiedBy

      public ProductTypeBuilder withLastModifiedBy(Function<LastModifiedByBuilder,LastModifiedBy> builder)

      Present on resources created after 1 February 2019 except for events not tracked.

      Parameters:
      builder - function to build the lastModifiedBy value
      Returns:
      Builder
    • lastModifiedBy

      public ProductTypeBuilder lastModifiedBy(@Nullable LastModifiedBy lastModifiedBy)

      Present on resources created after 1 February 2019 except for events not tracked.

      Parameters:
      lastModifiedBy - value to be set
      Returns:
      Builder
    • createdBy

      Present on resources created after 1 February 2019 except for events not tracked.

      Parameters:
      builder - function to build the createdBy value
      Returns:
      Builder
    • withCreatedBy

      public ProductTypeBuilder withCreatedBy(Function<CreatedByBuilder,CreatedBy> builder)

      Present on resources created after 1 February 2019 except for events not tracked.

      Parameters:
      builder - function to build the createdBy value
      Returns:
      Builder
    • createdBy

      public ProductTypeBuilder createdBy(@Nullable CreatedBy createdBy)

      Present on resources created after 1 February 2019 except for events not tracked.

      Parameters:
      createdBy - value to be set
      Returns:
      Builder
    • key

      User-defined unique identifier of the ProductType.

      Parameters:
      key - value to be set
      Returns:
      Builder
    • name

      public ProductTypeBuilder name(String name)

      Name of the ProductType.

      Parameters:
      name - value to be set
      Returns:
      Builder
    • description

      public ProductTypeBuilder description(String description)

      Description of the ProductType.

      Parameters:
      description - value to be set
      Returns:
      Builder
    • attributes

      public ProductTypeBuilder attributes(@Nullable AttributeDefinition... attributes)

      Attributes specified for the ProductType.

      Parameters:
      attributes - value to be set
      Returns:
      Builder
    • attributes

      public ProductTypeBuilder attributes(@Nullable List<AttributeDefinition> attributes)

      Attributes specified for the ProductType.

      Parameters:
      attributes - value to be set
      Returns:
      Builder
    • plusAttributes

      public ProductTypeBuilder plusAttributes(@Nullable AttributeDefinition... attributes)

      Attributes specified for the ProductType.

      Parameters:
      attributes - value to be set
      Returns:
      Builder
    • plusAttributes

      Attributes specified for the ProductType.

      Parameters:
      builder - function to build the attributes value
      Returns:
      Builder
    • withAttributes

      Attributes specified for the ProductType.

      Parameters:
      builder - function to build the attributes value
      Returns:
      Builder
    • addAttributes

      Attributes specified for the ProductType.

      Parameters:
      builder - function to build the attributes value
      Returns:
      Builder
    • setAttributes

      Attributes specified for the ProductType.

      Parameters:
      builder - function to build the attributes value
      Returns:
      Builder
    • getId

      public String getId()

      Unique identifier of the ProductType.

      Returns:
      id
    • getVersion

      public Long getVersion()

      Current version of the ProductType.

      Returns:
      version
    • getCreatedAt

      public ZonedDateTime getCreatedAt()

      Date and time (UTC) the ProductType was initially created.

      Returns:
      createdAt
    • getLastModifiedAt

      public ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the ProductType was last updated.

      Returns:
      lastModifiedAt
    • getLastModifiedBy

      @Nullable public LastModifiedBy getLastModifiedBy()

      Present on resources created after 1 February 2019 except for events not tracked.

      Returns:
      lastModifiedBy
    • getCreatedBy

      @Nullable public CreatedBy getCreatedBy()

      Present on resources created after 1 February 2019 except for events not tracked.

      Returns:
      createdBy
    • getKey

      @Nullable public String getKey()

      User-defined unique identifier of the ProductType.

      Returns:
      key
    • getName

      public String getName()

      Name of the ProductType.

      Returns:
      name
    • getDescription

      public String getDescription()

      Description of the ProductType.

      Returns:
      description
    • getAttributes

      @Nullable public List<AttributeDefinition> getAttributes()

      Attributes specified for the ProductType.

      Returns:
      attributes
    • build

      public ProductType build()
      builds ProductType with checking for non-null required values
      Specified by:
      build in interface io.vrap.rmf.base.client.Builder<ProductType>
      Returns:
      ProductType
    • buildUnchecked

      public ProductType buildUnchecked()
      builds ProductType without checking for non-null required values
      Returns:
      ProductType
    • of

      public static ProductTypeBuilder of()
      factory method for an instance of ProductTypeBuilder
      Returns:
      builder
    • of

      public static ProductTypeBuilder of(ProductType template)
      create builder for ProductType instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder