public static boolean isValid ( final String value ) { if ( value == null ) { return true ; } final String uuidPattern = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-" + "[0-9a-f]{4}-[0-9a-f]{12}$" ; return Pattern . matches ( uuidPattern , value ) ; }
Verifies that a given string is a valid UUID .