public static long getLong(Map<String, String> map, String key) {
        String val = map.get(key);
        if (val != null) {
            try {
                return Long.parseLong(val);
            } catch (NumberFormatException e) {
                throw new RuntimeException("Invalid value for key " + key + ": " + val, e);
            }
        }
        return 0;
    }
Collection of utility methods for working with maps.
client-v2/src/main/java/com/clickhouse/client/api/internal/MapUtils.java