public static final UUID parseUUID ( String value ) { UUID result = null ; if ( value != null && ! value . isEmpty ( ) ) { if ( value . charAt ( 0 ) == ' ' ) { // PMXML representation: <GUID>{0AB9133E-A09A-9648-B98A-B2384894AC44}</GUID> result = UUID . fromString ( value . substring ( 1 , value . length ( ) - 1 ) ) ; } else { // XER representation: CrkTPqCalki5irI4SJSsRA byte [ ] data = javax . xml . bind . DatatypeConverter . parseBase64Binary ( value + "==" ) ; long msb = 0 ; long lsb = 0 ; for ( int i = 0 ; i < 8 ; i ++ ) { msb = ( msb << 8 ) | ( data [ i ] & 0xff ) ; } for ( int i = 8 ; i < 16 ; i ++ ) { lsb = ( lsb << 8 ) | ( data [ i ] & 0xff ) ; } result = new UUID ( msb , lsb ) ; } } return result ; }
Convert the Primavera string representation of a UUID into a Java UUID instance .