/** @param id schema id @param clsLoader clsLoader the class loader which will be used for the resolution @return the single schema reduced from the multiple schemes resolved @throws Exception */ static Map<String, Object> resolveAndReduce(final String id, final ClassLoader clsLoader) throws Exception { return reduceForest(resolve(id, clsLoader)); } }
static Config resolveAndReduce( final String id, final ClassLoader clsLoader, final String pathSep, final Map<String, Object> schema ) throws Exception { final List<Config> resolvedConfigs = resolve(id, clsLoader, pathSep, schema); if(resolvedConfigs == null || resolvedConfigs.size() == 0) { return null; } final List<Map<String, Object>> configForest = resolvedConfigs .stream() .map(c -> c.mapVal(Config.ROOT_PATH)) .collect(Collectors.toList()); final Map<String, Object> configTree = reduceForest(configForest); return new BasicConfig(pathSep, schema, configTree); } }