Class UUIDVersion1Delegate

java.lang.Object
com.buralotech.oss.identifier.uuid.UUIDVersion1Delegate
All Implemented Interfaces:
UUIDVersionDelegate

@Deprecated(since="1.3.0") public class UUIDVersion1Delegate extends Object implements UUIDVersionDelegate
Deprecated.
Use invalid input: '{@link /*missing*/}'UUIDVersion6Delegate} for new developments.
Encapsulates the logic that is specific to the modified type 1 UUID format.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final long
    Deprecated.
    The adjustment to apply to convert UUID epoch to Unix Epoch.
    private final com.fasterxml.uuid.NoArgGenerator
    Deprecated.
    Used to generate time based UUIDs.
    private static final long
    Deprecated.
    Mask to remove the UUID version.
    private static final Pattern
    Deprecated.
    The regular expression pattern used to validate identifiers.
    private static final int
    Deprecated.
    The number of nanoseconds in a UUID tick.
    private static final long
    Deprecated.
    Number of ticks per second.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    fromTicks(long ticks, long suffix)
    Deprecated.
    Create a UUID as a byte array from a timestamp.
    byte[]
    Deprecated.
    Generate an identifier using an underlying UUID generator.
    boolean
    isValidBinary(byte[] binary)
    Deprecated.
    Check that the binary representation is valid.
    boolean
    Deprecated.
    Check that the text representation is valid.
    private void
    swap(byte[] bytes, int len)
    Deprecated.
    Swap the first len bytes of the array with the subsequent len bytes.
    toInstant(byte[] binary)
    Deprecated.
    Extract the timestamp from the UUID.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PATTERN

      private static final Pattern PATTERN
      Deprecated.
      The regular expression pattern used to validate identifiers.
    • MASK

      private static final long MASK
      Deprecated.
      Mask to remove the UUID version.
      See Also:
    • TICKS_PER_SECOND

      private static final long TICKS_PER_SECOND
      Deprecated.
      Number of ticks per second. TheUUID thick is 100 nanoseconds.
      See Also:
    • TICK_NANOS

      private static final int TICK_NANOS
      Deprecated.
      The number of nanoseconds in a UUID tick.
      See Also:
    • EPOCH_ADJ

      private static final long EPOCH_ADJ
      Deprecated.
      The adjustment to apply to convert UUID epoch to Unix Epoch. The UUID epoch 15 October 1582, while the Unix epoch is 1 January 1970.
      See Also:
    • generator

      private final com.fasterxml.uuid.NoArgGenerator generator
      Deprecated.
      Used to generate time based UUIDs.
  • Constructor Details

    • UUIDVersion1Delegate

      public UUIDVersion1Delegate()
      Deprecated.
  • Method Details

    • generate

      public byte[] generate()
      Deprecated.
      Generate an identifier using an underlying UUID generator.
      Specified by:
      generate in interface UUIDVersionDelegate
      Returns:
      The generated identifier as a byte array.
    • swap

      private void swap(byte[] bytes, int len)
      Deprecated.
      Swap the first len bytes of the array with the subsequent len bytes.
      Parameters:
      bytes - The byte array.
      len - The number of bytes to swap.
    • isValidBinary

      public boolean isValidBinary(byte[] binary)
      Deprecated.
      Check that the binary representation is valid. The service has already checked that it is non-null and a valid length.
      Specified by:
      isValidBinary in interface UUIDVersionDelegate
      Parameters:
      binary - The binary representation.
      Returns:
      true if the binary representation is valid. Otherwise, false.
    • isValidText

      public boolean isValidText(String text)
      Deprecated.
      Check that the text representation is valid. The service has already checked that it is non-null and a valid length.
      Specified by:
      isValidText in interface UUIDVersionDelegate
      Parameters:
      text - The binary representation.
      Returns:
      true if the text representation is valid. Otherwise, false.
    • toInstant

      public Instant toInstant(byte[] binary)
      Deprecated.
      Extract the timestamp from the UUID.
      Specified by:
      toInstant in interface UUIDVersionDelegate
      Parameters:
      binary - The binary representation of the UUID.
      Returns:
      The timestamp as an Instant.
    • fromTicks

      public byte[] fromTicks(long ticks, long suffix)
      Deprecated.
      Create a UUID as a byte array from a timestamp.
      Specified by:
      fromTicks in interface UUIDVersionDelegate
      Parameters:
      ticks - The timestamp in 100 nanoseconds.
      suffix - The second portion of the UUID.
      Returns:
      The UUID as a byte array.