- java.lang.Object
-
- io.github.mmm.entity.id.AbstractId<E,I,Instant>
-
- io.github.mmm.entity.id.AbstractInstantId<E,Long>
-
- io.github.mmm.entity.id.LongInstantId<E>
-
- Type Parameters:
E
- the generic type of the identified entity.
- All Implemented Interfaces:
Id<E>
public class LongInstantId<E> extends AbstractInstantId<E,Long>
- Since:
- 1.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LongInstantId.Factory
IdFactory
implementation.
-
Field Summary
Fields Modifier and Type Field Description static LongInstantId.Factory
FACTORY
-
Fields inherited from interface io.github.mmm.entity.id.Id
PROPERTY_ID, PROPERTY_VERSION, VERSION_LATEST, VERSION_SEPARATOR
-
-
Constructor Summary
Constructors Modifier Constructor Description LongInstantId(Class<E> type, long id, Instant version)
The constructor.protected
LongInstantId(Class<E> type, Long id, Instant version)
The constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LongInstantId.Factory
getFactory()
Long
getId()
long
getIdAsLong()
static <E> LongInstantId<E>
of(Class<E> type, Long id)
static <E> LongInstantId<E>
of(Class<E> type, Long id, Instant version)
-
Methods inherited from class io.github.mmm.entity.id.AbstractInstantId
getVersion
-
Methods inherited from class io.github.mmm.entity.id.AbstractId
equals, getIdAs, getType, getVersionAs, getVersionAsLong, getWithType, hashCode, parseUuid, toString, toString, withLatestVersion, withType, withVersion
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.github.mmm.entity.id.Id
getIdAsString, getVersionAsString
-
-
-
-
Field Detail
-
FACTORY
public static final LongInstantId.Factory FACTORY
- See Also:
getFactory()
-
-
Constructor Detail
-
LongInstantId
public LongInstantId(Class<E> type, long id, Instant version)
The constructor.- Parameters:
type
- thetype
.id
- theprimary key
. SeegetIdAsLong()
.version
- theversion
.
-
LongInstantId
protected LongInstantId(Class<E> type, Long id, Instant version)
The constructor.- Parameters:
type
- thetype
.id
- theprimary key
. SeegetIdAsLong()
.version
- theversion
.
-
-
Method Detail
-
getId
public Long getId()
- Specified by:
getId
in interfaceId<E>
- Specified by:
getId
in classAbstractId<E,Long,Instant>
- Returns:
- the primary key of the identified
Entity
asObject
value. It is only unique for a particulartype
of an entity. - See Also:
LongVersionId
,UuidVersionId
,StringVersionId
-
getIdAsLong
public long getIdAsLong()
- Returns:
- the
primary key
as primitvelong
value.
-
getFactory
public LongInstantId.Factory getFactory()
- Specified by:
getFactory
in classAbstractId<E,Long,Instant>
- Returns:
- the
IdFactory
responsible for thisId
implementation.
-
of
public static <E> LongInstantId<E> of(Class<E> type, Long id)
- Type Parameters:
E
- the generic type of the identified entity.- Parameters:
type
- thetype
.id
- theprimary key
.- Returns:
- the new
LongInstantId
ornull
if the givenid
wasnull
.
-
of
public static <E> LongInstantId<E> of(Class<E> type, Long id, Instant version)
- Type Parameters:
E
- the generic type of the identified entity.- Parameters:
type
- thetype
.id
- theprimary key
.version
- theversion
.- Returns:
- the new
LongInstantId
ornull
if the givenid
wasnull
.
-
-