public static ConfigSource[] getConfigSources() { return getConfigProvider().getConfig().getConfigSources(); }
public static ConfigSource[] getConfigSources() { return getConfigProvider().getConfig().getConfigSources(); }
/** * 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); }
public static ConfigurableTestConfigSource instance() { return (ConfigurableTestConfigSource) Arrays.stream(ConfigResolver.getConfig().getConfigSources()) .filter(cs -> cs instanceof ConfigurableTestConfigSource) .findFirst() .get(); }
/** * 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); }
/** * Resolve all values for the given key. * * @param key * * @return a List of all found property values, sorted by their ordinal in ascending order * * @see org.apache.deltaspike.core.spi.config.ConfigSource#getOrdinal() */ public static List<String> getAllPropertyValues(String key) { ConfigSource[] configSources = getConfigProvider().getConfig().getConfigSources(); List<String> result = new ArrayList<String>(); for (int i = configSources.length; i > 0; i--) { String value = configSources[i - 1].getPropertyValue(key); if (value != null) { value = filterConfigValue(key, value); if (!result.contains(value)) { result.add(value); } } } return result; }
/** * Resolve all values for the given key. * * @param key * * @return a List of all found property values, sorted by their ordinal in ascending order * * @see org.apache.deltaspike.core.spi.config.ConfigSource#getOrdinal() */ public static List<String> getAllPropertyValues(String key) { ConfigSource[] configSources = getConfigProvider().getConfig().getConfigSources(); List<String> result = new ArrayList<String>(); for (int i = configSources.length; i > 0; i--) { String value = configSources[i - 1].getPropertyValue(key); if (value != null) { value = filterConfigValue(key, value); if (!result.contains(value)) { result.add(value); } } } return result; }