/** * Return whether a configuration property group (class) has been white listed as being a "main" group. */ private boolean isWhiteListed(ConfigurationMetadataGroup group, Collection<String> classes) { Set<String> sourceTypes = group.getSources().keySet(); return !sourceTypes.isEmpty() && classes.containsAll(sourceTypes); }
/** * Return whether a configuration property group (class) has been white listed as * being a "main" group. */ private boolean isWhiteListed(ConfigurationMetadataGroup group, Collection<String> classes) { Set<String> sourceTypes = group.getSources().keySet(); return !sourceTypes.isEmpty() && classes.containsAll(sourceTypes); }
/** * Return whether a configuration property group (class) has been white listed as * being a "main" group. */ private boolean isWhiteListed(ConfigurationMetadataGroup group, Collection<String> classes) { Set<String> sourceTypes = group.getSources().keySet(); return !sourceTypes.isEmpty() && classes.containsAll(sourceTypes); }
/** * Merge the content of the specified repository to this repository. * @param repository the repository to include */ public void include(ConfigurationMetadataRepository repository) { for (ConfigurationMetadataGroup group : repository.getAllGroups().values()) { ConfigurationMetadataGroup existingGroup = this.allGroups.get(group.getId()); if (existingGroup == null) { this.allGroups.put(group.getId(), group); } else { // Merge properties group.getProperties().forEach((name, value) -> putIfAbsent( existingGroup.getProperties(), name, value)); // Merge sources group.getSources().forEach((name, value) -> putIfAbsent(existingGroup.getSources(), name, value)); } } }
/** * Register the specified {@link ConfigurationMetadataSource sources}. * @param sources the sources to add */ public void add(Collection<ConfigurationMetadataSource> sources) { for (ConfigurationMetadataSource source : sources) { String groupId = source.getGroupId(); ConfigurationMetadataGroup group = this.allGroups.get(groupId); if (group == null) { group = new ConfigurationMetadataGroup(groupId); this.allGroups.put(groupId, group); } String sourceType = source.getType(); if (sourceType != null) { putIfAbsent(group.getSources(), sourceType, source); } } }