public enum MultiValueConfigLoader extends java.lang.Enum<MultiValueConfigLoader>
Basically a request comes in for a value like "MONGODB-default" or "MONGODB-primary"
We resolve this like the following (and in this order)
1. Look for a -D property of the same name, all caps (i.e. toUpper)
2. Look for an environment variable of the same name, all caps (i.e. toUpper)
3. Look for a file using the discovery path in ConfigFileReader
| Enum Constant and Description |
|---|
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getConfig(java.lang.String configName) |
static java.lang.String |
getConfig(java.lang.String configName,
java.lang.String defaultValue) |
static java.util.Set<java.lang.String> |
getConfigKeys(java.lang.String primary) |
static void |
setEnvReader(ValueReader reader) |
static void |
setSysPropReader(ValueReader reader) |
static MultiValueConfigLoader |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static MultiValueConfigLoader[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
static void |
writeConfig(java.lang.String configName,
java.lang.String value)
By default attempt to store this in the FILE implementation, as that is the only one known to be persistent.
|
public static final MultiValueConfigLoader INSTANCE
public static MultiValueConfigLoader[] values()
for (MultiValueConfigLoader c : MultiValueConfigLoader.values()) System.out.println(c);
public static MultiValueConfigLoader valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic static void setEnvReader(ValueReader reader)
public static void setSysPropReader(ValueReader reader)
public static java.lang.String getConfig(java.lang.String configName,
java.lang.String defaultValue)
public static void writeConfig(java.lang.String configName,
java.lang.String value)
Write this into the first file found, or create a new file at the last search point.
configName - value - public static java.lang.String getConfig(java.lang.String configName)
public static java.util.Set<java.lang.String> getConfigKeys(java.lang.String primary)