@ComponentProfile(summary="unique id generator that is globally unique, but contains a time component", since="3.9.1") public class GuidGeneratorWithTime extends GuidGenerator
GuidGenerator
but contains
a date/time component.
You can use this IdGenerator
if you need to record the date that a GUID was generated.
The date that the GUID was generated can be found using the computeTime(String)
method.
In the adapter configuration file this class is aliased as guid-generator-with-time which is the preferred alternative to the fully qualified classname when building your configuration.
Modifier and Type | Class and Description |
---|---|
protected static interface |
GuidGeneratorWithTime.BytesProvider |
Modifier and Type | Field and Description |
---|---|
protected static int |
RANDOM_BYTE_LENGTH |
protected static int |
TIME_BYTE_LENGTH |
protected static int |
TIME_SIGNIFICANT_BYTES_OFFSET |
protected static int |
UUID_LENGTH |
Constructor and Description |
---|
GuidGeneratorWithTime() |
Modifier and Type | Method and Description |
---|---|
static java.util.Date |
computeTime(java.lang.String uuid)
Returns a date that contains the time portion of the UUID.
|
java.lang.String |
getUUID()
Get the next unique ID.
|
protected static byte[] |
someBytes(GuidGeneratorWithTime.BytesProvider p) |
create, safeUUID
protected static final int TIME_SIGNIFICANT_BYTES_OFFSET
protected static final int TIME_BYTE_LENGTH
protected static final int RANDOM_BYTE_LENGTH
protected static final int UUID_LENGTH
public java.lang.String getUUID()
GuidGenerator
getUUID
in class GuidGenerator
public static java.util.Date computeTime(java.lang.String uuid)
uuid
- the uuid generated by getUUID()
.Date
object computed from the UUID.protected static byte[] someBytes(GuidGeneratorWithTime.BytesProvider p)