public static boolean getFlag(Map<String, String> map, String key) {
        String val = map.get(key);
        if (val == null) {
            throw new NullPointerException("Missing value for the key '" + key + "'");
        }
        if (val.equalsIgnoreCase("true")) {
            return true;
        } else if (val.equalsIgnoreCase("false")) {
            return false;
        }

        throw new IllegalArgumentException("Invalid non-boolean value for the key '" + key + "': '" + val + "'");
    }
Get a boolean value from a map.

@param map map to get value from
@param key key to get value for
@return boolean value
@throws NullPointerException if the key is missing
@throws IllegalArgumentException if the value is not a boolean
client-v2/src/main/java/com/clickhouse/client/api/internal/MapUtils.java