class ConnectorOptions {

    public static <T> T extractOptionAsType(Map<String, ?> options,
                                                            String key, Class<T> requiredClass, T defaultValue) {
        if (options == null) {
            return defaultValue;
        }

        return Optional.ofNullable(options.get(key))
            .filter(requiredClass::isInstance)
            .map(requiredClass::cast)
            .orElse(defaultValue);
    }

    private  ConnectorOptions();

}