Class GUID
java.lang.Object
com.aquima.interactions.foundation.GUID
- All Implemented Interfaces:
Serializable
,Comparable<GUID>
The GUID class is a simple wrapper class for a string representing a unique identifier.
This class does enforce a few restrictions on the format of the string:
- The string may not be empty or null.
- The string may not contain any whitespaces.
The following processing is done on the string by the GUID class:
- GUID strings are not case sensitive.
- Excess whitespaces at the start and end of the string are stripped.
- Since:
- 5.0
- Author:
- o.kerpershoek
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
static GUID
generate()
This method generates a new random unique GUID.getValue()
This method returns the internal value of the GUID.int
hashCode()
toString()
Get the string representation of this GUID.static GUID
This method will convert a given string to a GUID.
-
Constructor Details
-
GUID
-
-
Method Details
-
valueOf
This method will convert a given string to a GUID. When an empty string or null is provided, this method will return null. When an invalid string is provided, this method will throw an invalid argument exception.- Parameters:
stringRepresentation
- string containing the identifier.- Returns:
- A valid GUID class, or null.
-
generate
This method generates a new random unique GUID.- Returns:
- a new random unique GUID.
-
getValue
This method returns the internal value of the GUID. This value may be different to the original value passed to the GUID constructor, as the GUID performs a number of conversions.- Returns:
- Internal value of the GUID.
-
compareTo
- Specified by:
compareTo
in interfaceComparable<GUID>
-
hashCode
public int hashCode() -
equals
-
toString
Get the string representation of this GUID.
-