private Boolean asBoolean(String s,Boolean defaultValue) {
        if (s == null) return defaultValue;
        if (s.isEmpty()) return defaultValue;
        if ("true".equals(s)) return true;
        if ("false".equals(s)) return false;
        throw new IllegalArgumentException("Expected 'true' or 'false' but was'" + s + "'");
    }
Returns true if the string is "true".
Returns false if the string is "false".
Returns <code>default</code> if the string is null or empty (this parameter may be null).

@throws IllegalArgumentException if the string has any other value
container-search/src/main/java/com/yahoo/search/query/profile/config/QueryProfileXMLReader.java