Class TimeBasedUuidCreator

    • Constructor Detail

      • TimeBasedUuidCreator

        public TimeBasedUuidCreator()
      • TimeBasedUuidCreator

        protected TimeBasedUuidCreator​(UuidVersion version)
    • Method Detail

      • formatMostSignificantBits

        protected long formatMostSignificantBits​(long timestamp)
        Returns the timestamp bits of the UUID in the order defined in the RFC-4122. ### RFC-4122 - 4.2.2. Generation Details Determine the values for the UTC-based timestamp and clock sequence to be used in the UUID, as described in Section 4.2.1. For the purposes of this algorithm, consider the timestamp to be a 60-bit unsigned integer and the clock sequence to be a 14-bit unsigned integer. Sequentially number the bits in a field, starting with zero for the least significant bit. "Set the time_low field equal to the least significant 32 bits (bits zero through 31) of the timestamp in the same order of significance. Set the time_mid field equal to bits 32 through 47 from the timestamp in the same order of significance. Set the 12 least significant bits (bits zero through 11) of the time_hi_and_version field equal to bits 48 through 59 from the timestamp in the same order of significance. Set the four most significant bits (bits 12 through 15) of the time_hi_and_version field to the 4-bit version number corresponding to the UUID version being created, as shown in the table above."
        Specified by:
        formatMostSignificantBits in class AbstractTimeBasedUuidCreator
        Parameters:
        timestamp - a timestamp
        Returns:
        the MSB