private Map<String, String> getCurrentEnvironmentProperties() { Map<String, String> currentEnvironment = new HashMap<>(); Set<String> keys = new HashSet<>(); for (PropertySource<?> propertySource : ((AbstractEnvironment) this.environment).getPropertySources()) { if (propertySource instanceof MapPropertySource) { keys.addAll(Arrays.asList(((MapPropertySource) propertySource).getPropertyNames())); } } for (String key : keys) { currentEnvironment.put(key, this.environment.getProperty(key)); } return currentEnvironment; } }
private Map<String, String> getCurrentEnvironmentProperties() { Map<String, String> currentEnvironment = new HashMap<>(); Set<String> keys = new HashSet<>(); for (PropertySource<?> propertySource : ((AbstractEnvironment) this.environment).getPropertySources()) { if (propertySource instanceof MapPropertySource) { keys.addAll(Arrays.asList(((MapPropertySource) propertySource).getPropertyNames())); } } for (String key : keys) { currentEnvironment.put(key, this.environment.getProperty(key)); } return currentEnvironment; } }
/** * config log settings */ private void assemblyLogSetting(ConfigurableEnvironment environment) { StreamSupport.stream(environment.getPropertySources().spliterator(), false) .filter(propertySource -> propertySource instanceof EnumerablePropertySource) .map(propertySource -> Arrays .asList(((MapPropertySource) propertySource).getPropertyNames())) .flatMap(Collection::stream).filter(LogEnvUtils::filterAllLogConfig) .forEach((key) -> HIGH_PRIORITY_CONFIG.getSource().put(key, environment.getProperty(key))); }
for (String propertyName : inputMappingMapPropertySource.getPropertyNames()) { Object resolvedPropertyValue = null; try {