Package org.apache.solr.util
Class IdUtils
- java.lang.Object
-
- org.apache.solr.util.IdUtils
-
public class IdUtils extends Object
Helper class for generating unique ID-s.
-
-
Constructor Summary
Constructors Constructor Description IdUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
randomId()
Generate a short random id (seeStringHelper.randomId()
).static String
timeRandomId()
Generate a random id with a timestamp, in the format:hex(timestamp) + 'T' + randomId
.static String
timeRandomId(long time)
Generate a random id with a timestamp, in the format:hex(timestamp) + 'T' + randomId
.
-
-
-
Method Detail
-
randomId
public static final String randomId()
Generate a short random id (seeStringHelper.randomId()
).
-
timeRandomId
public static final String timeRandomId()
Generate a random id with a timestamp, in the format:hex(timestamp) + 'T' + randomId
. This method usesTimeSource.CURRENT_TIME
for timestamp values.
-
timeRandomId
public static final String timeRandomId(long time)
Generate a random id with a timestamp, in the format:hex(timestamp) + 'T' + randomId
.- Parameters:
time
- value representing timestamp
-
-