public static boolean getBooleanValue ( String value ) throws IllegalArgumentException { require ( "true" . equalsIgnoreCase ( value ) || "false" . equalsIgnoreCase ( value ) , "'true' or 'false' expected: " + value ) ; return "true" . equalsIgnoreCase ( value ) ; }
Verify that the given value is either true or false and return the corresponding boolean value . If the value is invalid an IllegalArgumentException is thrown .