Class GlobalIDFactory


  • @ThreadSafe
    public final class GlobalIDFactory
    extends Object
    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 Detail

    • Method Detail

      • hasIntIDFactory

        public static boolean hasIntIDFactory()
      • hasPersistentIntIDFactory

        public static boolean hasPersistentIntIDFactory()
      • hasLongIDFactory

        public static boolean hasLongIDFactory()
      • hasPersistentLongIDFactory

        public static boolean hasPersistentLongIDFactory()
      • hasStringIDFactory

        public static boolean hasStringIDFactory()
      • hasPersistentStringIDFactory

        public static boolean hasPersistentStringIDFactory()
      • 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

        @Nonnull
        public static String getNewStringID()
        Returns:
        A new String ID
      • getNewPersistentStringID

        @Nonnull
        public static String getNewPersistentStringID()
        Returns:
        A new persistent String ID
      • getBulkNewIntIDs

        public static int[] getBulkNewIntIDs​(@Nonnegative
                                             int nCount)
        Parameters:
        nCount - The number of IDs to retrieve. Must be > 0.
        Returns:
        An array of new int IDs
      • getBulkNewPersistentIntIDs

        public static int[] getBulkNewPersistentIntIDs​(@Nonnegative
                                                       int nCount)
        Parameters:
        nCount - The number of IDs to retrieve. Must be > 0.
        Returns:
        An array of new persistent int IDs
      • getBulkNewLongIDs

        public static long[] getBulkNewLongIDs​(@Nonnegative
                                               int nCount)
        Parameters:
        nCount - The number of IDs to retrieve. Must be > 0.
        Returns:
        An array of new long IDs
      • getBulkNewPersistentLongIDs

        public static long[] getBulkNewPersistentLongIDs​(@Nonnegative
                                                         int nCount)
        Parameters:
        nCount - The number of IDs to retrieve. Must be > 0.
        Returns:
        An array of new persistent long IDs
      • getBulkNewStringIDs

        @Nonnull
        public static String[] getBulkNewStringIDs​(@Nonnegative
                                                   int nCount)
        Parameters:
        nCount - The number of IDs to retrieve
        Returns:
        An array of new String IDs
      • getBulkNewPersistentStringIDs

        @Nonnull
        public static String[] getBulkNewPersistentStringIDs​(@Nonnegative
                                                             int nCount)
        Parameters:
        nCount - The number of IDs to retrieve. Must be > 0.
        Returns:
        An array of new persistent String IDs