Class CustomerSigninBuilder

java.lang.Object
com.commercetools.api.models.customer.CustomerSigninBuilder
All Implemented Interfaces:
Builder<CustomerSignin>

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

     CustomerSignin customerSignin = CustomerSignin.builder()
             .email("{email}")
             .password("{password}")
             .build()
 
  • Constructor Details

    • CustomerSigninBuilder

      public CustomerSigninBuilder()
  • Method Details

    • email

      public CustomerSigninBuilder email(String email)

      Email address of the Customer treated as case-insensitive.

      Parameters:
      email - value to be set
      Returns:
      Builder
    • password

      public CustomerSigninBuilder password(String password)

      Password of the Customer.

      Parameters:
      password - value to be set
      Returns:
      Builder
    • anonymousCartId

      @Deprecated public CustomerSigninBuilder anonymousCartId(@Nullable String anonymousCartId)
      Deprecated.

      Deprecated since it is now possible to identify an anonymous cart by using its id or external key.

      Parameters:
      anonymousCartId - value to be set
      Returns:
      Builder
    • anonymousCart

      Identifies a Cart that will be assigned to the Customer.

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

      Identifies a Cart that will be assigned to the Customer.

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

      public CustomerSigninBuilder anonymousCart(@Nullable CartResourceIdentifier anonymousCart)

      Identifies a Cart that will be assigned to the Customer.

      Parameters:
      anonymousCart - value to be set
      Returns:
      Builder
    • anonymousCartSignInMode

      public CustomerSigninBuilder anonymousCartSignInMode(@Nullable AnonymousCartSignInMode anonymousCartSignInMode)
      • Set to MergeWithExistingCustomerCart if LineItems of the anonymous Cart should be merged with the active Customer Cart that has been modified most recently.
      • Set to UseAsNewActiveCustomerCart if the anonymous Cart should be used as the new active Customer Cart and no LineItems are to be merged.
      Parameters:
      anonymousCartSignInMode - value to be set
      Returns:
      Builder
    • anonymousId

      public CustomerSigninBuilder anonymousId(@Nullable String anonymousId)

      If both anonymousCart and anonymousId are provided, the anonymousId on the CustomerSignin must match that of the anonymous Cart. Otherwise a 400 Bad Request Invalid Operation error is returned with the message: "Cart with the ID cart-id does not have the expected anonymousId.".

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

      public CustomerSigninBuilder updateProductData(@Nullable Boolean updateProductData)
      • If true, the LineItem Product data (name, variant, and productType) of the returned Cart will be updated.
      • If false, only the prices, discounts, and tax rates will be updated.
      Parameters:
      updateProductData - value to be set
      Returns:
      Builder
    • getEmail

      public String getEmail()

      Email address of the Customer treated as case-insensitive.

      Returns:
      email
    • getPassword

      public String getPassword()

      Password of the Customer.

      Returns:
      password
    • getAnonymousCartId

      @Deprecated @Nullable public String getAnonymousCartId()
      Deprecated.

      Deprecated since it is now possible to identify an anonymous cart by using its id or external key.

      Returns:
      anonymousCartId
    • getAnonymousCart

      @Nullable public CartResourceIdentifier getAnonymousCart()

      Identifies a Cart that will be assigned to the Customer.

      Returns:
      anonymousCart
    • getAnonymousCartSignInMode

      @Nullable public AnonymousCartSignInMode getAnonymousCartSignInMode()
      • Set to MergeWithExistingCustomerCart if LineItems of the anonymous Cart should be merged with the active Customer Cart that has been modified most recently.
      • Set to UseAsNewActiveCustomerCart if the anonymous Cart should be used as the new active Customer Cart and no LineItems are to be merged.
      Returns:
      anonymousCartSignInMode
    • getAnonymousId

      @Nullable public String getAnonymousId()

      If both anonymousCart and anonymousId are provided, the anonymousId on the CustomerSignin must match that of the anonymous Cart. Otherwise a 400 Bad Request Invalid Operation error is returned with the message: "Cart with the ID cart-id does not have the expected anonymousId.".

      Returns:
      anonymousId
    • getUpdateProductData

      @Nullable public Boolean getUpdateProductData()
      • If true, the LineItem Product data (name, variant, and productType) of the returned Cart will be updated.
      • If false, only the prices, discounts, and tax rates will be updated.
      Returns:
      updateProductData
    • build

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

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

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

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