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

public static int stringToBooleanValueEL ( String str ) { if ( str . length ( ) < 2 ) return - 1 ; switch ( str . charAt ( 0 ) ) { case 't' : case 'T' : return str . equalsIgnoreCase ( "true" ) ? 1 : - 1 ; case 'f' : case 'F' : return str . equalsIgnoreCase ( "false" ) ? 0 : - 1 ; case 'y' : case 'Y' : return str . equalsIgnoreCase ( "yes" ) ? 1 : - 1 ; case 'n' : case 'N' : return str . equalsIgnoreCase ( "no" ) ? 0 : - 1 ; } return - 1 ; }
cast a string to a boolean value ( primitive value type ) , return 1 for true , 0 for false and - 1 if can ' t cast to a boolean type
