Class Unique
- java.lang.Object
-
- de.uplanet.lucy.server.auxiliaries.Unique
-
@VelocityCallable("singleton") @VelocityVariable("Unique") public final class Unique extends ObjectUtility class to create unique identifiers and names.
-
-
Constructor Summary
Constructors Constructor Description Unique()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisGuid(String p_strId)Test wether the given string is a GUID.StringnewGuid()Create a new GUID.StringnewIdValue(String p_strKey)Deterministically create a new ID attribute value from the given key.intnewUniqueInt()Create a new GUID and return it's absolute hash code.StringnewVariableName()Create a new unique variable name with the prefixl_idfollowed by up to nineteen decimal digits.StringnewVariableName(String p_strPrefix)Create a new unique variable name with a specified prefix followed by up to nineteen decimal digits.
-
-
-
Method Detail
-
newGuid
public String newGuid()
Create a new GUID.- Returns:
- The new GUID's string representation.
-
newUniqueInt
public int newUniqueInt()
Create a new GUID and return it's absolute hash code.- Returns:
- A unique integer.
-
isGuid
public boolean isGuid(String p_strId)
Test wether the given string is a GUID.- Parameters:
p_strId- The string to test.- Returns:
trueif the given string is a GUID,falseotherwise.
-
newIdValue
public String newIdValue(String p_strKey)
Deterministically create a new ID attribute value from the given key.- Parameters:
p_strKey- A key.- Returns:
ID_+<GUID>.
-
newVariableName
public String newVariableName()
Create a new unique variable name with the prefixl_idfollowed by up to nineteen decimal digits.- Returns:
- The newly created unique variable name.
-
-