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
Nested ClassesModifier and TypeClassDescriptionstatic classJAXB adapter forIdentitythat convertsIdentityinstances to and fromStringusing the identity token asStringrepresentation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic TokenIdentityCreates theTokenIdentityfrom the identity token inStringform.@NotBlank StringReturns the identity token.inthashCode()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:
getIdentityTokenin interfaceIdentity- Returns:
- The identity token
-
hashCode
public int hashCode() -
equals
-
toString
-
fromToken
Creates theTokenIdentityfrom the identity token inStringform. If the token isnullor empty returnsnull.- Parameters:
token- The identity token- Returns:
- The created
TokenIdentityinstance, ornullif invalid token
-