Class VariantCreatedMessageBuilder

java.lang.Object
com.commercetools.api.models.message.VariantCreatedMessageBuilder
All Implemented Interfaces:
Builder<VariantCreatedMessage>

public class VariantCreatedMessageBuilder extends Object implements Builder<VariantCreatedMessage>
VariantCreatedMessageBuilder
Example to create an instance using the builder pattern

     VariantCreatedMessage variantCreatedMessage = VariantCreatedMessage.builder()
             .id("{id}")
             .version(0.3)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .sequenceNumber(0.3)
             .resource(resourceBuilder -> resourceBuilder)
             .resourceVersion(0.3)
             .productId("{productId}")
             .variantId(1)
             .publish(true)
             .build()
 
  • Constructor Details

    • VariantCreatedMessageBuilder

      public VariantCreatedMessageBuilder()
  • Method Details

    • id

      Unique identifier of the Variant.

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

      public VariantCreatedMessageBuilder version(Long version)

      Version of a resource. In case of Messages, this is always 1.

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

      public VariantCreatedMessageBuilder createdAt(ZonedDateTime createdAt)

      Date and time (UTC) the Message was generated.

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

      public VariantCreatedMessageBuilder lastModifiedAt(ZonedDateTime lastModifiedAt)

      Value of createdAt.

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

      IDs and references that last modified the Message.

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

      IDs and references that last modified the Message.

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

      public VariantCreatedMessageBuilder lastModifiedBy(@Nullable LastModifiedBy lastModifiedBy)

      IDs and references that last modified the Message.

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

      IDs and references that created the Message.

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

      IDs and references that created the Message.

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

      public VariantCreatedMessageBuilder createdBy(@Nullable CreatedBy createdBy)

      IDs and references that created the Message.

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

      public VariantCreatedMessageBuilder sequenceNumber(Long sequenceNumber)

      Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

      Parameters:
      sequenceNumber - value to be set
      Returns:
      Builder
    • resource

      public VariantCreatedMessageBuilder resource(Reference resource)

      Reference to the resource on which the change or action was performed.

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

      Reference to the resource on which the change or action was performed.

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

      public VariantCreatedMessageBuilder resourceVersion(Long resourceVersion)

      Version of the resource on which the change or action was performed.

      Parameters:
      resourceVersion - value to be set
      Returns:
      Builder
    • resourceUserProvidedIdentifiers

      User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

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

      User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

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

      public VariantCreatedMessageBuilder resourceUserProvidedIdentifiers(@Nullable UserProvidedIdentifiers resourceUserProvidedIdentifiers)

      User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

      Parameters:
      resourceUserProvidedIdentifiers - value to be set
      Returns:
      Builder
    • productId

      public VariantCreatedMessageBuilder productId(String productId)

      Unique identifier of the Product to which the Variant belongs.

      Parameters:
      productId - value to be set
      Returns:
      Builder
    • variantId

      public VariantCreatedMessageBuilder variantId(Integer variantId)

      Unique identifier of the Variant within its parent Product.

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

      public VariantCreatedMessageBuilder key(@Nullable String key)

      User-defined unique identifier of the Variant.

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

      public VariantCreatedMessageBuilder sku(@Nullable String sku)

      SKU of the Variant.

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

      public VariantCreatedMessageBuilder attributes(@Nullable Attribute... attributes)

      Attributes of the Variant.

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

      public VariantCreatedMessageBuilder attributes(@Nullable List<Attribute> attributes)

      Attributes of the Variant.

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

      public VariantCreatedMessageBuilder plusAttributes(@Nullable Attribute... attributes)

      Attributes of the Variant.

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

      Attributes of the Variant.

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

      Attributes of the Variant.

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

      Attributes of the Variant.

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

      Attributes of the Variant.

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

      public VariantCreatedMessageBuilder assets(@Nullable Asset... assets)

      Assets of the Variant.

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

      public VariantCreatedMessageBuilder assets(@Nullable List<Asset> assets)

      Assets of the Variant.

      Parameters:
      assets - value to be set
      Returns:
      Builder
    • plusAssets

      public VariantCreatedMessageBuilder plusAssets(@Nullable Asset... assets)

      Assets of the Variant.

      Parameters:
      assets - value to be set
      Returns:
      Builder
    • plusAssets

      Assets of the Variant.

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

      Assets of the Variant.

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

      Assets of the Variant.

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

      Assets of the Variant.

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

      public VariantCreatedMessageBuilder images(@Nullable Image... images)

      Images of the Variant.

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

      public VariantCreatedMessageBuilder images(@Nullable List<Image> images)

      Images of the Variant.

      Parameters:
      images - value to be set
      Returns:
      Builder
    • plusImages

      public VariantCreatedMessageBuilder plusImages(@Nullable Image... images)

      Images of the Variant.

      Parameters:
      images - value to be set
      Returns:
      Builder
    • plusImages

      Images of the Variant.

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

      Images of the Variant.

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

      Images of the Variant.

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

      Images of the Variant.

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

      public VariantCreatedMessageBuilder publish(Boolean publish)

      Whether the Variant was published.

      Parameters:
      publish - value to be set
      Returns:
      Builder
    • getId

      public String getId()

      Unique identifier of the Variant.

      Returns:
      id
    • getVersion

      public Long getVersion()

      Version of a resource. In case of Messages, this is always 1.

      Returns:
      version
    • getCreatedAt

      public ZonedDateTime getCreatedAt()

      Date and time (UTC) the Message was generated.

      Returns:
      createdAt
    • getLastModifiedAt

      public ZonedDateTime getLastModifiedAt()

      Value of createdAt.

      Returns:
      lastModifiedAt
    • getLastModifiedBy

      @Nullable public LastModifiedBy getLastModifiedBy()

      IDs and references that last modified the Message.

      Returns:
      lastModifiedBy
    • getCreatedBy

      @Nullable public CreatedBy getCreatedBy()

      IDs and references that created the Message.

      Returns:
      createdBy
    • getSequenceNumber

      public Long getSequenceNumber()

      Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

      Returns:
      sequenceNumber
    • getResource

      public Reference getResource()

      Reference to the resource on which the change or action was performed.

      Returns:
      resource
    • getResourceVersion

      public Long getResourceVersion()

      Version of the resource on which the change or action was performed.

      Returns:
      resourceVersion
    • getResourceUserProvidedIdentifiers

      @Nullable public UserProvidedIdentifiers getResourceUserProvidedIdentifiers()

      User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

      Returns:
      resourceUserProvidedIdentifiers
    • getProductId

      public String getProductId()

      Unique identifier of the Product to which the Variant belongs.

      Returns:
      productId
    • getVariantId

      public Integer getVariantId()

      Unique identifier of the Variant within its parent Product.

      Returns:
      variantId
    • getKey

      @Nullable public String getKey()

      User-defined unique identifier of the Variant.

      Returns:
      key
    • getSku

      @Nullable public String getSku()

      SKU of the Variant.

      Returns:
      sku
    • getAttributes

      @Nullable public List<Attribute> getAttributes()

      Attributes of the Variant.

      Returns:
      attributes
    • getAssets

      @Nullable public List<Asset> getAssets()

      Assets of the Variant.

      Returns:
      assets
    • getImages

      @Nullable public List<Image> getImages()

      Images of the Variant.

      Returns:
      images
    • getPublish

      public Boolean getPublish()

      Whether the Variant was published.

      Returns:
      publish
    • build

      public VariantCreatedMessage build()
      builds VariantCreatedMessage with checking for non-null required values
      Specified by:
      build in interface Builder<VariantCreatedMessage>
      Returns:
      VariantCreatedMessage
    • buildUnchecked

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

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

      create builder for VariantCreatedMessage instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder