Class CustomerTokenBuilder
java.lang.Object
com.commercetools.api.models.customer.CustomerTokenBuilder
- All Implemented Interfaces:
Builder<CustomerToken>
CustomerTokenBuilder
Example to create an instance using the builder pattern
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"))
.invalidateOlderTokens(true)
.createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()builds CustomerToken with checking for non-null required valuesbuilds CustomerToken without checking for non-null required valuescreatedAt(ZonedDateTime createdAt) Date and time (UTC) the token was initially created.customerId(String customerId) Theidof the Customer.expiresAt(ZonedDateTime expiresAt) Date and time (UTC) the token expires.Date and time (UTC) the token was initially created.Theidof the Customer.Date and time (UTC) the token expires.getId()Unique identifier of the token.Iftrue, all tokens issued previously for the Customer will be invalidated.When the token is created,lastModifiedAtis set tocreatedAt.getValue()Value of the token.Unique identifier of the token.invalidateOlderTokens(Boolean invalidateOlderTokens) Iftrue, all tokens issued previously for the Customer will be invalidated.lastModifiedAt(ZonedDateTime lastModifiedAt) When the token is created,lastModifiedAtis set tocreatedAt.static CustomerTokenBuilderof()factory method for an instance of CustomerTokenBuilderstatic CustomerTokenBuilderof(CustomerToken template) create builder for CustomerToken instanceValue of the token.
-
Constructor Details
-
CustomerTokenBuilder
public CustomerTokenBuilder()
-
-
Method Details
-
id
Unique identifier of the token.
- Parameters:
id- value to be set- Returns:
- Builder
-
customerId
The
idof the Customer.- Parameters:
customerId- value to be set- Returns:
- Builder
-
value
Value of the token.
- Parameters:
value- value to be set- Returns:
- Builder
-
expiresAt
Date and time (UTC) the token expires.
- Parameters:
expiresAt- value to be set- Returns:
- Builder
-
invalidateOlderTokens
If
true, all tokens issued previously for the Customer will be invalidated.- Parameters:
invalidateOlderTokens- value to be set- Returns:
- Builder
-
createdAt
Date and time (UTC) the token was initially created.
- Parameters:
createdAt- value to be set- Returns:
- Builder
-
lastModifiedAt
When the token is created,
lastModifiedAtis set tocreatedAt.- Parameters:
lastModifiedAt- value to be set- Returns:
- Builder
-
getId
Unique identifier of the token.
- Returns:
- id
-
getCustomerId
The
idof the Customer.- Returns:
- customerId
-
getValue
Value of the token.
- Returns:
- value
-
getExpiresAt
Date and time (UTC) the token expires.
- Returns:
- expiresAt
-
getInvalidateOlderTokens
If
true, all tokens issued previously for the Customer will be invalidated.- Returns:
- invalidateOlderTokens
-
getCreatedAt
Date and time (UTC) the token was initially created.
- Returns:
- createdAt
-
getLastModifiedAt
When the token is created,
lastModifiedAtis set tocreatedAt.- Returns:
- lastModifiedAt
-
build
builds CustomerToken with checking for non-null required values- Specified by:
buildin interfaceBuilder<CustomerToken>- Returns:
- CustomerToken
-
buildUnchecked
builds CustomerToken without checking for non-null required values- Returns:
- CustomerToken
-
of
factory method for an instance of CustomerTokenBuilder- Returns:
- builder
-
of
create builder for CustomerToken instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-