Skip to content

Commit

Permalink
Merge pull request #481 from Emily-Jiang/revert-binary-incompatible-c…
Browse files Browse the repository at this point in the history
…hanges

#431 - undo this change as it has binary incompatible changes
  • Loading branch information
Emily-Jiang authored Dec 13, 2019
2 parents 43aa6b6 + 0cf4c85 commit 927c223
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
*******************************************************************************/
package org.eclipse.microprofile.config.spi;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

Expand Down Expand Up @@ -82,21 +81,19 @@ public interface ConfigSource {
* Return the properties in this config source
* @return the map containing the properties in this config source
*/
default Map<String, String> getProperties() {
Map<String, String> props = new HashMap<>();
getPropertyNames().stream().forEach((prop) -> props.put(prop, getValue(prop)));
return props;
}
Map<String, String> getProperties();

/**
* Gets all property names known to this config source, potentially without evaluating the values.
* Gets all property names known to this config source, without evaluating the values.
*
* For backwards compatibility, there is a default implementation that just returns the keys of {@code getProperties()}
* slower ConfigSource implementations should replace this with a more performant implementation
*
* @return the set of property keys that are known to this ConfigSource
*/
Set<String> getPropertyNames();
default Set<String> getPropertyNames() {
return getProperties().keySet();
}

/**
* Return the ordinal for this config source. If a property is specified in multiple config sources, the value
Expand Down

0 comments on commit 927c223

Please sign in to comment.