Package dev.orne.beans
Class AbstractSimpleIdentity<T extends Serializable>
java.lang.Object
dev.orne.beans.AbstractIdentity
dev.orne.beans.AbstractSimpleIdentity<T>
- Type Parameters:
T
- The type of the identity value
- All Implemented Interfaces:
Identity
,Serializable
- Direct Known Subclasses:
BigIntegerIdentity
,LongIdentity
,StringIdentity
@API(status=STABLE,
since="0.1")
public abstract class AbstractSimpleIdentity<T extends Serializable>
extends AbstractIdentity
Abstract implementation for
Identity
for identities composed
of a single inner value.- Since:
- 0.1
- Version:
- 1.0, 2020-05
- Author:
- (w) Iker Hernaez
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractSimpleIdentity
(@NotNull AbstractSimpleIdentity<T> copy) Copy constructor.protected
AbstractSimpleIdentity
(T value) Creates a new instance. -
Method Summary
Methods inherited from class dev.orne.beans.AbstractIdentity
getIdentityToken, getIdentityTokenPrefix, parseIdentityTokenBody, toString
-
Constructor Details
-
AbstractSimpleIdentity
Creates a new instance.- Parameters:
value
- The identity value
-
AbstractSimpleIdentity
Copy constructor.- Parameters:
copy
- The instance to copy
-
-
Method Details
-
getValue
Returns the identity inner value.- Returns:
- The identity inner value
-
getIdentityTokenBody
Returns the identity token body composed from the values of this identity. Equal instances must return equal identity token body.- Specified by:
getIdentityTokenBody
in classAbstractIdentity
- Returns:
- The identity token body for this instance
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractIdentity
-
equals
- Overrides:
equals
in classAbstractIdentity
-