Class PreviewTokenValidated
java.lang.Object
com.broadleafcommerce.sandbox.web.endpoint.PreviewTokenValidated
The details provided when a preview token is validated.
If found valid, the valid(PreviewToken, Set)
static constructor
should be used to provide the response.
If found invalid, the PreviewTokenValidated#invalid()
static constructor should be used
to provide the response.
- Author:
- Nick Crum (ncrum)
-
Method Summary
Modifier and TypeMethodDescriptionboolean
com.broadleafcommerce.data.tracking.core.preview.PreviewToken
If valid, this will include the content of the decoded preview token.If invalid, this will include the reason for why the token was found not to be valid.If valid, this will include the set ofSandbox
available for preview.int
hashCode()
static PreviewTokenValidated
Static constructor used for instantiating an invalid response.boolean
isValid()
Whether or not the token provided is valid.toString()
static PreviewTokenValidated
valid
(com.broadleafcommerce.data.tracking.core.preview.PreviewToken content, Set<Sandbox> sandboxes) Static constructor used for instantiating a valid response.
-
Method Details
-
valid
public static PreviewTokenValidated valid(@NonNull com.broadleafcommerce.data.tracking.core.preview.PreviewToken content, @NonNull Set<Sandbox> sandboxes) Static constructor used for instantiating a valid response.- Parameters:
content
- the decoded preview tokensandboxes
- the set of sandboxes supported- Returns:
- the valid response object
-
invalid
Static constructor used for instantiating an invalid response.- Returns:
- the invalid response object
-
isValid
public boolean isValid()Whether or not the token provided is valid.- Returns:
- whether or not the token is valid
-
getContent
@Nullable public com.broadleafcommerce.data.tracking.core.preview.PreviewToken getContent()If valid, this will include the content of the decoded preview token.If not valid, this will be
null
.- Returns:
- the content of the decoded preview token
-
getSandboxes
If valid, this will include the set ofSandbox
available for preview. This sandbox information may be used for display purposes in the client.If not valid, this will be empty.
- Returns:
- the set of sandboxes this preview token supports
-
getReason
If invalid, this will include the reason for why the token was found not to be valid. -
equals
-
hashCode
public int hashCode() -
toString
-