Package dev.orne.beans
Interface Identity
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractComposedIdentity
,AbstractIdentity
,AbstractSimpleIdentity
,BigIntegerIdentity
,LongIdentity
,StringIdentity
,TokenIdentity
Interface representing the identity of a bean. Allows hiding the actual
identity implementation from referencing users.
The implementations of this interface must be inmutable.
- Since:
- 0.1
- Version:
- 1.0, 2020-05
- Author:
- (w) Iker Hernaez
-
Method Summary
Modifier and TypeMethodDescription@NotNull @ValidIdentityToken String
Returns the identity token.default <T extends Identity>
TResolves this identity to an identity of the specified target type.
-
Method Details
-
getIdentityToken
Returns the identity token. This token must be unique among non equal instances of the same type of tokens.- Returns:
- The identity token
-
resolve
Resolves this identity to an identity of the specified target type.- Type Parameters:
T
- The target identity type- Parameters:
type
- The target identity type- Returns:
- An instance of target identity type
- Throws:
UnrecognizedIdentityTokenException
- If this identity's token cannot be resolved to target identity type
-