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"))
.createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.build()
-
Constructor Summary
-
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) Theid
of the Customer.expiresAt
(ZonedDateTime expiresAt) Date and time (UTC) the token expires.Date and time (UTC) the token was initially created.Theid
of the Customer.Date and time (UTC) the token expires.getId()
Unique identifier of the token.When the token is created,lastModifiedAt
is set tocreatedAt
.getValue()
Value of the token.Unique identifier of the token.lastModifiedAt
(ZonedDateTime lastModifiedAt) When the token is created,lastModifiedAt
is set tocreatedAt
.static CustomerTokenBuilder
of()
factory method for an instance of CustomerTokenBuilderstatic CustomerTokenBuilder
of
(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
id
of 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
-
createdAt
Date and time (UTC) the token was initially created.
- Parameters:
createdAt
- value to be set- Returns:
- Builder
-
lastModifiedAt
When the token is created,
lastModifiedAt
is set tocreatedAt
.- Parameters:
lastModifiedAt
- value to be set- Returns:
- Builder
-
getId
Unique identifier of the token.
- Returns:
- id
-
getCustomerId
The
id
of the Customer.- Returns:
- customerId
-
getValue
Value of the token.
- Returns:
- value
-
getExpiresAt
Date and time (UTC) the token expires.
- Returns:
- expiresAt
-
getCreatedAt
Date and time (UTC) the token was initially created.
- Returns:
- createdAt
-
getLastModifiedAt
When the token is created,
lastModifiedAt
is set tocreatedAt
.- Returns:
- lastModifiedAt
-
build
builds CustomerToken with checking for non-null required values- Specified by:
build
in 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
-