Detailed Description
Helpers to obtain keys from the environment.
Static Public Member Functions | |
| static String | getResourceKey (String legacyKeyName) |
| Obtain a resource key from an environment variable or a system property. | |
| static String | getNamedKey (String keyName) |
| Obtain a key either from environment variable or from a property. | |
| static boolean | isInvalidKey (String keyValue) |
| Evaluate whether a key might be valid. | |
Static Public Attributes | |
| static final String | RESOURCE_KEY_VARIABLE = "_51DEGREES_RESOURCE_KEY" |
| Name of the aligned environment variable or system property which supplies the resource key. | |
| static final String | RESOURCE_KEY_ENV_VAR = "51DEGREES_RESOURCE_KEY" |
The old name of RESOURCE_KEY_VARIABLE, read only when that one is not set. | |
Member Function Documentation
◆ getNamedKey()
|
static |
Obtain a key either from environment variable or from a property.
Try resource key as env var, then as upper case env var, the system property
◆ getResourceKey()
|
static |
Obtain a resource key from an environment variable or a system property.
The aligned name RESOURCE_KEY_VARIABLE is checked first. When it is not set or is empty the deprecated RESOURCE_KEY_ENV_VAR is checked, and its first use is reported on standard error. The supplied legacy name is checked last. Each name is looked up using getNamedKey(String).
- Parameters
-
legacyKeyName legacy name to try when the aligned name is not set
- Returns
- the resource key, or null if no name is set
◆ isInvalidKey()
|
static |
Evaluate whether a key might be valid.
- Parameters
-
keyValue value to test
- Returns
- boolean
Member Data Documentation
◆ RESOURCE_KEY_ENV_VAR
|
static |
The old name of RESOURCE_KEY_VARIABLE, read only when that one is not set.
- Deprecated
- use
RESOURCE_KEY_VARIABLE, and set the variable it names in place of this one.
◆ RESOURCE_KEY_VARIABLE
|
static |
Name of the aligned environment variable or system property which supplies the resource key.
This name is checked before any legacy name.
