Package com.helger.commons.id.factory
Class GlobalIDFactory
java.lang.Object
com.helger.commons.id.factory.GlobalIDFactory
This class should not be static since it may have an impact if this class is
used by different projects which have a separate IntID factory.
- Author:
- Philip Helger
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default prefix to use for creating IDsstatic final intThe maximum string length of IDs created by the String based ID factory. -
Method Summary
Modifier and TypeMethodDescriptionstatic int[]getBulkNewIntIDs(int nCount) static long[]getBulkNewLongIDs(int nCount) static int[]getBulkNewPersistentIntIDs(int nCount) static long[]getBulkNewPersistentLongIDs(int nCount) static String[]getBulkNewPersistentStringIDs(int nCount) static String[]getBulkNewStringIDs(int nCount) static IIntIDFactorystatic ILongIDFactorystatic intstatic longstatic intstatic longstatic Stringstatic Stringstatic IIntIDFactorystatic ILongIDFactorystatic IStringIDFactorystatic IStringIDFactorystatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic EChangesetIntIDFactory(IIntIDFactory aFactory) static EChangesetLongIDFactory(ILongIDFactory aFactory) static EChangesetPersistentIntIDFactory(IIntIDFactory aFactory) static EChangesetPersistentLongIDFactory(ILongIDFactory aFactory) static EChangesetPersistentStringIDFactory(IStringIDFactory aFactory) static EChangesetStringIDFactory(IStringIDFactory aFactory)
-
Field Details
-
DEFAULT_PREFIX
The default prefix to use for creating IDs- See Also:
-
STRING_ID_MAX_LENGTH
public static final int STRING_ID_MAX_LENGTHThe maximum string length of IDs created by the String based ID factory.- See Also:
-
-
Method Details
-
hasIntIDFactory
public static boolean hasIntIDFactory() -
getIntIDFactory
- Returns:
- The factory to create non-persistent int IDs. May be
null.
-
setIntIDFactory
-
hasPersistentIntIDFactory
public static boolean hasPersistentIntIDFactory() -
getPersistentIntIDFactory
- Returns:
- The factory to create persistent int IDs. May be
null.
-
setPersistentIntIDFactory
-
hasLongIDFactory
public static boolean hasLongIDFactory() -
getLongIDFactory
- Returns:
- The factory to create non-persistent long IDs. May be
null.
-
setLongIDFactory
-
hasPersistentLongIDFactory
public static boolean hasPersistentLongIDFactory() -
getPersistentLongIDFactory
- Returns:
- The factory to create persistent long IDs. May be
null.
-
setPersistentLongIDFactory
-
hasStringIDFactory
public static boolean hasStringIDFactory() -
getStringIDFactory
- Returns:
- The factory to create non-persistent string IDs. May be
null.
-
setStringIDFactory
-
hasPersistentStringIDFactory
public static boolean hasPersistentStringIDFactory() -
getPersistentStringIDFactory
- Returns:
- The factory to create persistent string IDs. May be
null.
-
setPersistentStringIDFactory
-
getNewIntID
public static int getNewIntID()- Returns:
- A new int ID
-
getNewPersistentIntID
public static int getNewPersistentIntID()- Returns:
- A new persistent int ID
-
getNewLongID
public static long getNewLongID()- Returns:
- A new long ID
-
getNewPersistentLongID
public static long getNewPersistentLongID()- Returns:
- A new persistent long ID
-
getNewStringID
- Returns:
- A new String ID
-
getNewPersistentStringID
- Returns:
- A new persistent String ID
-
getBulkNewIntIDs
- Parameters:
nCount- The number of IDs to retrieve. Must be > 0.- Returns:
- An array of new int IDs
-
getBulkNewPersistentIntIDs
- Parameters:
nCount- The number of IDs to retrieve. Must be > 0.- Returns:
- An array of new persistent int IDs
-
getBulkNewLongIDs
- Parameters:
nCount- The number of IDs to retrieve. Must be > 0.- Returns:
- An array of new long IDs
-
getBulkNewPersistentLongIDs
- Parameters:
nCount- The number of IDs to retrieve. Must be > 0.- Returns:
- An array of new persistent long IDs
-
getBulkNewStringIDs
- Parameters:
nCount- The number of IDs to retrieve- Returns:
- An array of new String IDs
-
getBulkNewPersistentStringIDs
- Parameters:
nCount- The number of IDs to retrieve. Must be > 0.- Returns:
- An array of new persistent String IDs
-