Class CreatedByBuilder

java.lang.Object
com.commercetools.api.models.common.CreatedByBuilder
All Implemented Interfaces:
Builder<CreatedBy>

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

     CreatedBy createdBy = CreatedBy.builder()
             .build()
 
  • Constructor Details

    • CreatedByBuilder

      public CreatedByBuilder()
  • Method Details

    • clientId

      public CreatedByBuilder clientId(@Nullable String clientId)

      id of the API Client which created the resource.

      Parameters:
      clientId - value to be set
      Returns:
      Builder
    • externalUserId

      public CreatedByBuilder externalUserId(@Nullable String externalUserId)

      External user ID provided by the X-External-User-ID HTTP Header or external_user_id:{externalUserId} scope.

      Parameters:
      externalUserId - value to be set
      Returns:
      Builder
    • customer

      Indicates the Customer who created the resource using a token from the password flow.

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

      Indicates the Customer who created the resource using a token from the password flow.

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

      public CreatedByBuilder customer(@Nullable CustomerReference customer)

      Indicates the Customer who created the resource using a token from the password flow.

      Parameters:
      customer - value to be set
      Returns:
      Builder
    • anonymousId

      public CreatedByBuilder anonymousId(@Nullable String anonymousId)

      Indicates the anonymous session during which the resource was created.

      Parameters:
      anonymousId - value to be set
      Returns:
      Builder
    • associate

      Indicates the Customer who created the resource in the context of a Business Unit. Only present when an Associate acts on behalf of a company using the associate endpoints.

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

      Indicates the Customer who created the resource in the context of a Business Unit. Only present when an Associate acts on behalf of a company using the associate endpoints.

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

      public CreatedByBuilder associate(@Nullable CustomerReference associate)

      Indicates the Customer who created the resource in the context of a Business Unit. Only present when an Associate acts on behalf of a company using the associate endpoints.

      Parameters:
      associate - value to be set
      Returns:
      Builder
    • attributedTo

      Indicates if the resource was created indirectly.

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

      public CreatedByBuilder withAttributedTo(Function<AttributionBuilder,Attribution> builder)

      Indicates if the resource was created indirectly.

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

      public CreatedByBuilder attributedTo(@Nullable Attribution attributedTo)

      Indicates if the resource was created indirectly.

      Parameters:
      attributedTo - value to be set
      Returns:
      Builder
    • getClientId

      @Nullable public String getClientId()

      id of the API Client which created the resource.

      Returns:
      clientId
    • getExternalUserId

      @Nullable public String getExternalUserId()

      External user ID provided by the X-External-User-ID HTTP Header or external_user_id:{externalUserId} scope.

      Returns:
      externalUserId
    • getCustomer

      @Nullable public CustomerReference getCustomer()

      Indicates the Customer who created the resource using a token from the password flow.

      Returns:
      customer
    • getAnonymousId

      @Nullable public String getAnonymousId()

      Indicates the anonymous session during which the resource was created.

      Returns:
      anonymousId
    • getAssociate

      @Nullable public CustomerReference getAssociate()

      Indicates the Customer who created the resource in the context of a Business Unit. Only present when an Associate acts on behalf of a company using the associate endpoints.

      Returns:
      associate
    • getAttributedTo

      @Nullable public Attribution getAttributedTo()

      Indicates if the resource was created indirectly.

      Returns:
      attributedTo
    • build

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

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

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

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