Interface CustomerToken
public interface CustomerToken
CustomerToken
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()
-
Method Summary
Modifier and TypeMethodDescriptionstatic CustomerTokenBuilderbuilder()builder factory method for CustomerTokenstatic CustomerTokenBuilderbuilder(CustomerToken template) create builder for CustomerToken instancecopyDeep()static CustomerTokendeepCopy(CustomerToken template) factory method to create a deep copy of CustomerToken@NotNull ZonedDateTimeDate and time (UTC) the token was initially created.@NotNull StringTheidof the Customer.@NotNull ZonedDateTimeDate and time (UTC) the token expires.@NotNull StringgetId()Unique identifier of the token.@NotNull BooleanIftrue, all tokens issued previously for the Customer will be invalidated.When the token is created,lastModifiedAtis set tocreatedAt.@NotNull StringgetValue()Value of the token.static CustomerTokenof()factory methodstatic CustomerTokenof(CustomerToken template) factory method to create a shallow copy CustomerTokenvoidsetCreatedAt(ZonedDateTime createdAt) Date and time (UTC) the token was initially created.voidsetCustomerId(String customerId) Theidof the Customer.voidsetExpiresAt(ZonedDateTime expiresAt) Date and time (UTC) the token expires.voidUnique identifier of the token.voidsetInvalidateOlderTokens(Boolean invalidateOlderTokens) Iftrue, all tokens issued previously for the Customer will be invalidated.voidsetLastModifiedAt(ZonedDateTime lastModifiedAt) When the token is created,lastModifiedAtis set tocreatedAt.voidValue of the token.static com.fasterxml.jackson.core.type.TypeReference<CustomerToken>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithCustomerToken(Function<CustomerToken, T> helper) accessor map function
-
Method Details
-
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
ZonedDateTime getLastModifiedAt()When the token is created,
lastModifiedAtis set tocreatedAt.- Returns:
- lastModifiedAt
-
setId
Unique identifier of the token.
- Parameters:
id- value to be set
-
setCustomerId
The
idof the Customer.- Parameters:
customerId- value to be set
-
setValue
Value of the token.
- Parameters:
value- value to be set
-
setExpiresAt
Date and time (UTC) the token expires.
- Parameters:
expiresAt- value to be set
-
setInvalidateOlderTokens
If
true, all tokens issued previously for the Customer will be invalidated.- Parameters:
invalidateOlderTokens- value to be set
-
setCreatedAt
Date and time (UTC) the token was initially created.
- Parameters:
createdAt- value to be set
-
setLastModifiedAt
When the token is created,
lastModifiedAtis set tocreatedAt.- Parameters:
lastModifiedAt- value to be set
-
of
factory method- Returns:
- instance of CustomerToken
-
of
factory method to create a shallow copy CustomerToken- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
CustomerToken copyDeep() -
deepCopy
factory method to create a deep copy of CustomerToken- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for CustomerToken- Returns:
- builder
-
builder
create builder for CustomerToken instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withCustomerToken
accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-