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 Details

    • Unique

      public Unique()
      Constructor.
  • Method Details

    • 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 prefix l_id followed by up to nineteen decimal digits.
      Returns:
      The newly created unique variable name.
    • newVariableName

      public String newVariableName(String p_strPrefix)
      Create a new unique variable name with a specified prefix followed by up to nineteen decimal digits.
      Parameters:
      p_strPrefix - The prefix to be used.
      Returns:
      The newly created unique variable name.