public static boolean getFlag(Map<String, ?> map, String key, boolean defaultValue) {
        Object val = map.get(key);
        if (val == null) {
            return defaultValue;
        }
        if (val instanceof Boolean) {
            return (Boolean) val;
        } else if (val instanceof String) {
            String str = (String) val;
            if (str.equalsIgnoreCase("true") || str.equalsIgnoreCase("1")) {
                return true;
            } else if (str.equalsIgnoreCase("false") || str.equalsIgnoreCase("0")) {
                return false;
            }
        }
        throw new IllegalArgumentException("Invalid non-boolean value for the key '" + key + "': '" + val + "'");
    }
Get a boolean value from a map.
@param map - configuration map
@param key - key of the property
@param defaultValue - value if not found
@return boolean value
client-v2/src/main/java/com/clickhouse/client/api/internal/MapUtils.java