How can I distinguish between a name and UUID?
![]() I'm working on a script that uses the RTC CLI to access RTC in which a user can reference an RTC object by either its name or its UUID. How can I determine if the user referenced the object by name or UUID. Can I take the object reference to be UUID if and only if it begins with an underscore?
|
Accepted answer
![]() If you have access to the RTC plain-Java API, you can call com.ibm.team.repository.common.UUID.valueOf(userSuppliedValue), and if that call throws an IllegalArgumentException, then it was not a valid UUID (that's the main fool proof way).
Geoff Alexander selected this answer as the correct answer
|