class NamedRuleUnitConfig {

    public static List<NamedRuleUnitConfig> fromContext(GeneratorContext context) {
        HashSet<String> canonicalNames = new HashSet<>();
        for (String k : context.getApplicationProperties()) {
            if (k.startsWith(CONFIG_PREFIX)) {
                String rest = k.substring(CONFIG_PREFIX.length());
                Optional<String> unitCanonicalName = parseQuotedIdentifier(rest);
                unitCanonicalName.ifPresent(canonicalNames::add);
            }
        }

        ArrayList<NamedRuleUnitConfig> configs = new ArrayList<>();
        for (String canonicalName : canonicalNames) {
            EventProcessingType eventProcessingType = context.getApplicationProperty(
                    String.format(CONFIG_EVENT_PROCESSING_TYPE, canonicalName))
                    .map(String::toUpperCase)
                    .map(EventProcessingType::valueOf)
                    .orElse(null);

            ClockType clockType = context.getApplicationProperty(
                    String.format(CONFIG_CLOCK_TYPE, canonicalName))
                    .map(String::toUpperCase)
                    .map(ClockType::valueOf)
                    .orElse(null);

            Optional<String> sp = context.getApplicationProperty(
                    String.format(CONFIG_SESSIONS_POOL, canonicalName));
            Integer sessionPool = sp.map(Integer::parseInt).orElse(null);

            configs.add(new NamedRuleUnitConfig(
                    canonicalName,
                    new RuleUnitConfig(
                            eventProcessingType,
                            clockType,
                            sessionPool)));
        }

        return configs;
    }

    public  NamedRuleUnitConfig(String canonicalName, RuleUnitConfig config);

}