UUID Class

Contains methods to randomly generate a version 4 universally unique identifier (UUID), compare UUIDs, and convert UUID instance to a string.

System

The UUID is generated using a cryptographically strong pseudo-random number generator and is represented as 32 hexadecimal values.

The following are methods for UUID.

  • equals(obj)

    Compares a UUID instance with the specified object and returns true if both are equal. Otherwise, returns false.

  • fromString(str)

    Converts a 32 character hexadecimal string representation of a UUID to a UUID instance.

  • hashCode()

    Returns the hashcode corresponding to the UUID instance.

  • randomUUID()

    A static method that randomly generates a version 4 UUID.

  • toString()

    Returns the string representation of the UUID instance.

Compares a UUID instance with the specified object and returns true if both are equal. Otherwise, returns false.

public Boolean equals(Object obj)

  • obj: Type: Object The UUID object to be compared.

Type: Boolean

Converts a 32 character hexadecimal string representation of a UUID to a UUID instance.

public static System.UUID fromString(String str)

Type: System.UUID

Returns the hashcode corresponding to the UUID instance.

public Integer hashCode()

Type: Integer

A static method that randomly generates a version 4 UUID.

public static System.UUID randomUUID()

Type: System.UUID

A 32 hexadecimal value of the UUID generated.

Returns the string representation of the UUID instance.

public String toString()

Type: String