- java.lang.Object
-
- io.github.mmm.entity.id.AbstractId<E,I,Instant>
-
- io.github.mmm.entity.id.AbstractInstantId<E,String>
-
- io.github.mmm.entity.id.StringInstantId<E>
-
- Type Parameters:
E- the generic type of the identified entity.
- All Implemented Interfaces:
Id<E>
public class StringInstantId<E> extends AbstractInstantId<E,String>
Implementation ofAbstractInstantIdusingStringasprimary key. This is the most generic type ofId. HoweverLongVersionIdandUuidVersionIdwill be more efficient.- Since:
- 1.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStringInstantId.FactoryIdFactoryimplementation.
-
Field Summary
Fields Modifier and Type Field Description static StringInstantId.FactoryFACTORY-
Fields inherited from interface io.github.mmm.entity.id.Id
PROPERTY_ID, PROPERTY_VERSION, VERSION_LATEST, VERSION_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description StringInstantId(Class<E> type, String id, Instant version)The constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringInstantId.FactorygetFactory()StringgetId()static <E> StringInstantId<E>of(Class<E> type, String id)static <E> StringInstantId<E>of(Class<E> type, String 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 StringInstantId.Factory FACTORY
- See Also:
getFactory()
-
-
Method Detail
-
getId
public String getId()
- Specified by:
getIdin interfaceId<E>- Specified by:
getIdin classAbstractId<E,String,Instant>- Returns:
- the primary key of the identified
EntityasObjectvalue. It is only unique for a particulartypeof an entity. - See Also:
LongVersionId,UuidVersionId,StringVersionId
-
getFactory
public StringInstantId.Factory getFactory()
- Specified by:
getFactoryin classAbstractId<E,String,Instant>- Returns:
- the
IdFactoryresponsible for thisIdimplementation.
-
of
public static <E> StringInstantId<E> of(Class<E> type, String id)
- Type Parameters:
E- the generic type of the identified entity.- Parameters:
type- thetype.id- theprimary key.- Returns:
- the new
StringInstantIdornullif the givenidwasnull.
-
of
public static <E> StringInstantId<E> of(Class<E> type, String id, Instant version)
- Type Parameters:
E- the generic type of the identified entity.- Parameters:
type- thetype.id- theprimary key.version- theversion.- Returns:
- the new
StringInstantIdornullif the givenidwasnull.
-
-