Package dev.orne.beans
Class TokenIdentity
java.lang.Object
dev.orne.beans.TokenIdentity
- All Implemented Interfaces:
Identity
,Serializable
Implementation of
Identity
for identities of unknown format restored
from identity tokens.- Since:
- 0.1
- Version:
- 1.0, 2020-05
- Author:
- (w) Iker Hernaez
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
JAXB adapter forIdentity
that convertsIdentity
instances to and fromString
using the identity token asString
representation. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static TokenIdentity
Creates theTokenIdentity
from the identity token inString
form.@NotBlank String
Returns the identity token.int
hashCode()
toString()
-
Constructor Details
-
TokenIdentity
Creates a new instance.- Parameters:
token
- The identity token
-
-
Method Details
-
getIdentityToken
Returns the identity token. This token must be unique among non equal instances of the same type of tokens.- Specified by:
getIdentityToken
in interfaceIdentity
- Returns:
- The identity token
-
hashCode
public int hashCode() -
equals
-
toString
-
fromToken
Creates theTokenIdentity
from the identity token inString
form. If the token isnull
or empty returnsnull
.- Parameters:
token
- The identity token- Returns:
- The created
TokenIdentity
instance, ornull
if invalid token
-