

public static UUID fromString (String name) Parameters name This is a string that specifies a UUID. Declaration Following is the declaration for () method. In the scheme of things it doesn’t matter too much but it’s an interesting quirk. java util UUID fromString() Method - The fromString(String name) method is used to create a UUID from the string standard representation as described in the. Description The fromString (String name) method is used to create a UUID from the string standard representation as described in the toString () method.

The ITU page about UUIDs also shows a string representation example with leading zeroes in the “node” field:Įxample: The following is an example of the string representation of a UUID as a URN: RFC 4122 states:Įach field is treated as an integer and has its value printed as a zero-filled hexadecimal digit string with the most significant digit first. More interestingly still, this behaviour doesn’t appear to be sanctioned by the RFC. Very confusing results will occur if the UUID appears to be accepted but it is the wrong value. fromString(name: String) Creates a UUID from the string standard representation as described in the toString method. This isn’t very helpful to me - a large part of what I’m trying to validate is that the user hasn’t accidentally omitted a character. I presume it thinks this 48-bit value has been emitted without the leading zero, and attempted to patch it up. You can see that the “node” field of the UUID (after the final -) has been prefixed with an extra 0. UUID (Universal Unique Identifier) is a 16-byte unique value.
