Package org.goplanit.utils.id
Class IdAbleImpl
- java.lang.Object
-
- org.goplanit.utils.id.IdAbleImpl
-
- All Implemented Interfaces:
Cloneable
,Comparable<IdAble>
,IdAble
- Direct Known Subclasses:
EventImpl
,ExternalIdAbleImpl
,OdDataImpl
,RemoveSubGraphListenerImpl
,UntypedGraphImpl
public abstract class IdAbleImpl extends Object implements IdAble
Implementation of Idable interface including hash and equals based on id- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description IdAbleImpl(long id)
constructorIdAbleImpl(IdAbleImpl other)
Copy constructor
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract IdAble
clone()
Create a shallow copy of this entityboolean
equals(Object o)
protected long
generateAndSetId(Class<?> classIdentifier, IdGroupingToken idtoken)
Convenience method to generate and set the id using a unique class identifier and idToken which in turn delegates to theIdGenerator.generateId()
protected static long
generateId(IdGroupingToken idGroupingToken, Class<? extends IdAble> clazz)
Generate an id based on provided token and classlong
getId()
Collect id of the entityint
hashCode()
protected void
setId(long id)
set the id-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, idEquals, idHashCode
-
-
-
-
Constructor Detail
-
IdAbleImpl
public IdAbleImpl(long id)
constructor- Parameters:
id
- to use
-
IdAbleImpl
public IdAbleImpl(IdAbleImpl other)
Copy constructor- Parameters:
other
- to copy from
-
-
Method Detail
-
generateAndSetId
protected long generateAndSetId(Class<?> classIdentifier, IdGroupingToken idtoken)
Convenience method to generate and set the id using a unique class identifier and idToken which in turn delegates to theIdGenerator.generateId()
- Parameters:
classIdentifier
- to useidtoken
- to use- Returns:
- generated and set id
-
generateId
protected static long generateId(IdGroupingToken idGroupingToken, Class<? extends IdAble> clazz)
Generate an id based on provided token and class- Parameters:
idGroupingToken
- to useclazz
- to register for- Returns:
- generated id
-
setId
protected void setId(long id)
set the id- Parameters:
id
- to set
-
getId
public long getId()
Collect id of the entity
-
-