code: public static UUID fromString(String str) {
          try {
              int dashCount = 4;
              final int [] dashPos = new int [6];
              dashPos[0] = -1;
              dashPos[5] = str.length();
  
              for (int i = str.length()-1; i >= 0; i--) {
                  if (str.charAt(i) == '-') {
                      if (dashCount == 0) {
                          throw new IllegalArgumentException("Too many dashes (-)");
                      }
                      dashPos[dashCount--] = i;
                  }
              }
  
              if (dashCount > 0) {
                  throw new IllegalArgumentException("Not enough dashes (-)");
              }
  
              long mostSigBits = decode(str, dashPos, 0) & 0xffffffffL;
              mostSigBits <<= 16;
              mostSigBits |= (decode(str, dashPos, 1) & 0xffffL);
              mostSigBits <<= 16;
              mostSigBits |= (decode(str,  dashPos, 2) & 0xffffL);
  
              long leastSigBits = (decode(str,  dashPos, 3) & 0xffffL);
              leastSigBits <<= 48;
              leastSigBits |= (decode(str,  dashPos, 4) & 0xffffffffffffL);
  
              return new UUID(mostSigBits, leastSigBits);
          }
          catch (IllegalArgumentException e) {
              throw new IllegalArgumentException("Invalid UUID string: " + str, e);
          }
      }
docs: FROM STRING