public static boolean isBoolean(String str){
  if (str.length() < 2)   return false;
switch (str.charAt(0)) {
case 't':
case 'T':
    return str.equalsIgnoreCase("true");
case 'f':
case 'F':
  return str.equalsIgnoreCase("false");
case 'y':
case 'Y':
return str.equalsIgnoreCase("yes");
case 'n':
case 'N':
return str.equalsIgnoreCase("no");
}
return false;
}

public static boolean isBoolean ( String str ) { if ( str . length ( ) < 2 ) return false ; switch ( str . charAt ( 0 ) ) { case 't' : case 'T' : return str . equalsIgnoreCase ( "true" ) ; case 'f' : case 'F' : return str . equalsIgnoreCase ( "false" ) ; case 'y' : case 'Y' : return str . equalsIgnoreCase ( "yes" ) ; case 'n' : case 'N' : return str . equalsIgnoreCase ( "no" ) ; } return false ; }
tests if value is a boolean
