public static boolean parseBool(String s){
  if (s != null) {
    if (s.startsWith("true") || s.startsWith("on") || s.startsWith("yes")) {
      return true;
    }
    if (s.startsWith("false") || s.startsWith("off") || s.equals("no")) {
      return false;
    }
  }
  throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,"invalid boolean value: " + s);
}

public static boolean parseBool ( String s ) { if ( s != null ) { if ( s . startsWith ( "true" ) || s . startsWith ( "on" ) || s . startsWith ( "yes" ) ) { return true ; } if ( s . startsWith ( "false" ) || s . startsWith ( "off" ) || s . equals ( "no" ) ) { return false ; } } throw new SolrException ( SolrException . ErrorCode . BAD_REQUEST , "invalid boolean value: " + s ) ; }
how to transform a string into a boolean . . . more flexible than boolean . parseboolean ( ) to enable easier integration with html forms .
