Generating a random UUID and getting the version
<p>I am trying to generate a UUID to a string, so that when I enter uuidcreaterandom, it will create a random UUID. I have pasted below what I tried, and am I missing something ? Any pointers much appreciated. Thank you..</p>

<pre><code>public UUID uuidCreateRandom() {
    return UUID.randomUUID();
}

public UUID uuidCreateFromHexString(String uuid) {
    return UUID.fromString(uuid);
}

public String uuidCreateRandom(UUID uuid) {
    return uuid.toString();
}

public int uuidGetVersion(UUID uuid) {
    return uuid.version();
}

public UUID get_uuid() {
    return _uuid;
}

public String get_uuidString() {
    return _uuidString;
}

public int get_uuidVersion() {
    return _uuidVersion;
}

public void set_uuid() {
    _uuid = UUID.randomUUID();
}

public void set_uuidString(UUID uuid) {
    _uuidString = uuid.toString();
}

public void set_uuidVersion(UUID uuid) {
    _uuidVersion = uuid.version();
}
</code></pre>