public static UUID uuidFromString(String str){
  if (str == null) {
    return null;
  }
  if (str.length() == 32) {
    StringBuilder sb=new StringBuilder(str);
    sb.insert(8,'-');
    sb.insert(13,'-');
    sb.insert(18,'-');
    sb.insert(23,'-');
    return UUID.fromString(sb.toString());
  }
 else {
    return UUID.fromString(str);
  }
}

public static UUID uuidFromString ( String str ) { if ( str == null ) { return null ; } if ( str . length ( ) == 32 ) { StringBuilder sb = new StringBuilder ( str ) ; sb . insert ( 8 , '-' ) ; sb . insert ( 13 , '-' ) ; sb . insert ( 18 , '-' ) ; sb . insert ( 23 , '-' ) ; return UUID . fromString ( sb . toString ( ) ) ; } else { return UUID . fromString ( str ) ; } }
expect strings in following 2 formats : 422f1dfd - ce07 - 2820 - 494e - bf3b9d5e74d8 422f1dfdce072820494ebf3b9d5e74d8
