class ConnectorOptions {

    public static void extractOptionAndConsume(Map<String, ?> options, String key,
                                                                   Consumer<String> consumer) {
        if (options == null) {
            return;
        }

        try {
            Optional.ofNullable(options.get(key))
                .map(Object::toString)
                .ifPresent(consumer);
        } catch (Exception ex) {
            LOG.error("Evaluation of option '" + key + "' failed.", ex);
        }
    }

    private  ConnectorOptions();

}