public static Map<String, String> getAllProperties() { List<ConfigSource> appConfigSources = sortAscending(new ArrayList<ConfigSource>(Arrays.asList(getConfigSources()))); Map<String, String> result = new HashMap<String, String>(); for (ConfigSource configSource : appConfigSources) { if (configSource.isScannable()) { result.putAll(configSource.getProperties()); } } return Collections.unmodifiableMap(result); }
/** * Returns a Map of all properties from all scannable config sources. The values of the properties reflect the * values that would be obtained by a call to {@link #getPropertyValue(java.lang.String)}, that is, the value of the * property from the ConfigSource with the highest ordinal. * * @see ConfigSource#isScannable() */ public static Map<String, String> getAllProperties() { ConfigSource[] configSources = getConfigProvider().getConfig().getConfigSources(); Map<String, String> result = new HashMap<String, String>(); for (int i = configSources.length; i > 0; i--) { ConfigSource configSource = configSources[i - 1]; if (configSource.isScannable()) { result.putAll(configSource.getProperties()); } } return Collections.unmodifiableMap(result); }
/** * Returns a Map of all properties from all scannable config sources. The values of the properties reflect the * values that would be obtained by a call to {@link #getPropertyValue(java.lang.String)}, that is, the value of the * property from the ConfigSource with the highest ordinal. * * @see ConfigSource#isScannable() */ public static Map<String, String> getAllProperties() { ConfigSource[] configSources = getConfigProvider().getConfig().getConfigSources(); Map<String, String> result = new HashMap<String, String>(); for (int i = configSources.length; i > 0; i--) { ConfigSource configSource = configSources[i - 1]; if (configSource.isScannable()) { result.putAll(configSource.getProperties()); } } return Collections.unmodifiableMap(result); }
private void setTestConfigSourceValue(String key, String value) { ConfigSource[] configSources = ConfigResolver.getConfigSources(); for (ConfigSource configSource : configSources) { if (configSource instanceof TestConfigSource) { if (value == null) { configSource.getProperties().remove(key); } else { configSource.getProperties().put(key, value); } break; } } }