Module buralotech.identifier.core
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
FieldsModifier and TypeFieldDescriptionprivate static final longDeprecated.The adjustment to apply to convert UUID epoch to Unix Epoch.private final com.fasterxml.uuid.NoArgGeneratorDeprecated.Used to generate time based UUIDs.private static final longDeprecated.Mask to remove the UUID version.private static final PatternDeprecated.The regular expression pattern used to validate identifiers.private static final intDeprecated.The number of nanoseconds in a UUID tick.private static final longDeprecated.Number of ticks per second. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]fromTicks(long ticks, long suffix) Deprecated.Create a UUID as a byte array from a timestamp.byte[]generate()Deprecated.Generate an identifier using an underlying UUID generator.booleanisValidBinary(byte[] binary) Deprecated.Check that the binary representation is valid.booleanisValidText(String text) Deprecated.Check that the text representation is valid.private voidswap(byte[] bytes, int len) Deprecated.Swap the firstlenbytes of the array with the subsequentlenbytes.toInstant(byte[] binary) Deprecated.Extract the timestamp from the UUID.
-
Field Details
-
PATTERN
Deprecated.The regular expression pattern used to validate identifiers. -
MASK
private static final long MASKDeprecated.Mask to remove the UUID version.- See Also:
-
TICKS_PER_SECOND
private static final long TICKS_PER_SECONDDeprecated.Number of ticks per second. TheUUID thick is 100 nanoseconds.- See Also:
-
TICK_NANOS
private static final int TICK_NANOSDeprecated.The number of nanoseconds in a UUID tick.- See Also:
-
EPOCH_ADJ
private static final long EPOCH_ADJDeprecated.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 generatorDeprecated.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:
generatein interfaceUUIDVersionDelegate- Returns:
- The generated identifier as a byte array.
-
swap
private void swap(byte[] bytes, int len) Deprecated.Swap the firstlenbytes of the array with the subsequentlenbytes.- 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:
isValidBinaryin interfaceUUIDVersionDelegate- Parameters:
binary- The binary representation.- Returns:
trueif the binary representation is valid. Otherwise,false.
-
isValidText
Deprecated.Check that the text representation is valid. The service has already checked that it is non-null and a valid length.- Specified by:
isValidTextin interfaceUUIDVersionDelegate- Parameters:
text- The binary representation.- Returns:
trueif the text representation is valid. Otherwise,false.
-
toInstant
Deprecated.Extract the timestamp from the UUID.- Specified by:
toInstantin interfaceUUIDVersionDelegate- 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:
fromTicksin interfaceUUIDVersionDelegate- Parameters:
ticks- The timestamp in 100 nanoseconds.suffix- The second portion of the UUID.- Returns:
- The UUID as a byte array.
-