Package com.spotfire.server.util
Class Guid
java.lang.Object
com.spotfire.server.util.Guid
- All Implemented Interfaces:
Serializable
This class represents an universally unique identifier (UUID), also known as globally unique identifier (GUID), see
This class uses randomly generated
UUID. A UUID represents a 128-bit value and is either guaranteed to be different from all other
UUIDs/GUIDs generated until 3400 A.D., or extremely likely to be different. This class uses randomly generated
UUID, i.e., an UUID of version type 4, see
UUID.version().- Since:
- 3.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGuid()Constructs a newGuid.Constructs a newGuidusing the specified guid string representation as described in thetoString()method. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares this object to the supplied object.inthashCode()Returns a hash code for thisGuid.static booleanTells whether or not the supplied guid string corresponds to a validGuid.static GuidConstructs a newGuidusing the specified guid string representation as described in thetoString()method.toString()Returns aStringrepresentation of thisGuid.
-
Field Details
-
EMPTY
A read-only Guid instance whose value is all zeros.
-
-
Constructor Details
-
Guid
public Guid()Constructs a newGuid.- Since:
- 3.0
-
Guid
Constructs a newGuidusing the specified guid string representation as described in thetoString()method.- Parameters:
guid- a string that specifies aGuid.- Throws:
IllegalArgumentException- if guid does not conform to the string representation of aGuidas described intoString().- Since:
- 3.0
-
-
Method Details
-
parseGuid
Constructs a newGuidusing the specified guid string representation as described in thetoString()method.- Parameters:
guid- a string that specifies aGuid.- Returns:
- a
Guidwith the specified value. - Throws:
IllegalArgumentException- if guid does not conform to the string representation of aGuidas described intoString().- Since:
- 3.0
-
isGuid
Tells whether or not the supplied guid string corresponds to a validGuid.- Parameters:
guid- a string that specifies aGuid.- Returns:
trueif guid corresponds to a validGuid,falseotherwise.- Since:
- 3.0
-
equals
Compares this object to the supplied object. The result istrueif the argument it notnull, it is of typeGuidand it contains the same value as thisGuid. -
hashCode
public int hashCode()Returns a hash code for thisGuid. -
toString
Returns aStringrepresentation of thisGuid. TheGuidstring representation is on the following format, where x represents a hexadecimal ([0-9][a-f][A-F]) digit, "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".
The returned string is always in lower case.
-