Class PrefixCombFactory


  • public final class PrefixCombFactory
    extends AbstCombFactory
    Concrete factory for creating Prefix COMB GUIDs.

    A Prefix COMB GUID is a UUID that combines a creation time with random bits.

    The creation millisecond is a 6 bytes PREFIX at the MOST significant bits.

    The created UUID is a UUIDv4 for compatibility with RFC 9562.

    See Also:
    The Cost of GUIDs as Primary Keys
    • Constructor Detail

      • PrefixCombFactory

        public PrefixCombFactory()
        Default constructor.
      • PrefixCombFactory

        public PrefixCombFactory​(Clock clock)
        Constructor with a clock.
        Parameters:
        clock - a clock
      • PrefixCombFactory

        public PrefixCombFactory​(Random random)
        Constructor with a random.
        Parameters:
        random - a random generator
      • PrefixCombFactory

        public PrefixCombFactory​(Random random,
                                 Clock clock)
        Constructor with a random and a clock.
        Parameters:
        random - a random
        clock - a clock
      • PrefixCombFactory

        public PrefixCombFactory​(LongSupplier randomFunction)
        Constructor with a function which return random numbers.
        Parameters:
        randomFunction - a function
      • PrefixCombFactory

        public PrefixCombFactory​(LongSupplier randomFunction,
                                 Clock clock)
        Constructor with a function which a function which return random numbers and a clock.
        Parameters:
        randomFunction - a function
        clock - a clock