class Paths implements ProgressCheckFactory {

    @Override
    public ProgressCheck newInstance(final JsonObject config) {
        List<Rule> rules = Rules.fromJsonArray(arrayOrEmpty(config, keys().rules()));

        final boolean denyAllDeletes = hasNonNull(config, keys().denyAllDeletes())
                && config.getBoolean(keys().denyAllDeletes());

        final Severity severity = Severity.valueOf(
                config.getString(keys().severity(), DEFAULT_SEVERITY.name()).toUpperCase());

        return new Check(rules, denyAllDeletes, severity);
    }

}