Class Unique
- java.lang.Object
-
- de.uplanet.lucy.server.auxiliaries.Unique
-
@VelocityCallable("singleton") @VelocityVariable("Unique") public final class Unique extends Object
Utility 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 boolean
isGuid(String p_strId)
Test wether the given string is a GUID.String
newGuid()
Create a new GUID.String
newIdValue(String p_strKey)
Deterministically create a new ID attribute value from the given key.int
newUniqueInt()
Create a new GUID and return it's absolute hash code.String
newVariableName()
Create a new unique variable name with the prefixl_id
followed by up to nineteen decimal digits.String
newVariableName(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:
true
if the given string is a GUID,false
otherwise.
-
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_id
followed by up to nineteen decimal digits.- Returns:
- The newly created unique variable name.
-
-