Class CustomerTokenBuilder

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

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

     CustomerToken customerToken = CustomerToken.builder()
             .id("{id}")
             .customerId("{customerId}")
             .value("{value}")
             .expiresAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .build()
 
  • Constructor Details

    • CustomerTokenBuilder

      public CustomerTokenBuilder()
  • Method Details

    • id

      public CustomerTokenBuilder id(String id)

      Unique identifier of the token.

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

      public CustomerTokenBuilder customerId(String customerId)

      The id of the Customer.

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

      public CustomerTokenBuilder value(String value)

      Value of the token.

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

      public CustomerTokenBuilder expiresAt(ZonedDateTime expiresAt)

      Date and time (UTC) the token expires.

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

      public CustomerTokenBuilder createdAt(ZonedDateTime createdAt)

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

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

      public CustomerTokenBuilder lastModifiedAt(@Nullable ZonedDateTime lastModifiedAt)

      When the token is created, lastModifiedAt is set to createdAt.

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

      public String getId()

      Unique identifier of the token.

      Returns:
      id
    • getCustomerId

      public String getCustomerId()

      The id of the Customer.

      Returns:
      customerId
    • getValue

      public String getValue()

      Value of the token.

      Returns:
      value
    • getExpiresAt

      public ZonedDateTime getExpiresAt()

      Date and time (UTC) the token expires.

      Returns:
      expiresAt
    • getCreatedAt

      public ZonedDateTime getCreatedAt()

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

      Returns:
      createdAt
    • getLastModifiedAt

      @Nullable public ZonedDateTime getLastModifiedAt()

      When the token is created, lastModifiedAt is set to createdAt.

      Returns:
      lastModifiedAt
    • build

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

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

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

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