Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to cast the String to UUID? (RTC SDK)

Hi guys,

I get a String type data from UUID type via ".getContextId().getUuidValue()".
Now I'd like to cast this String type to the UUID type. 
Is that possible and how to do that?

Thanks for reply!   

0 votes


Accepted answer

Permanent link
see the UUID.valueOf() method

from the plain java javadoc

public static UUID valueOf(java.lang.String uuidValue)
Reconstitute a UUID from a String representation. This method will do basic heuristic checking to see if it appears to be a valid representation for our UUID. This method serves as a mechanism for a client to rebuild a UUID object by value : it is expected that the value was derived from a valid UUID instance at some point in time.

Parameters:
uuidValue - desired value for new UUID
Returns:
UUID corresponding to specified value
Throws:
java.lang.IllegalArgumentException - for invalid uuidValue

Kenery Wang selected this answer as the correct answer

1 vote

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,935

Question asked: Aug 16 '13, 9:20 a.m.

Question was seen: 13,023 times

Last updated: Aug 18 '13, 11:25 a.m.

Confirmation Cancel Confirm