Package io.dropwizard.configuration
Class EnvironmentVariableLookup
- java.lang.Object
-
- org.apache.commons.text.StrLookup<Object>
-
- io.dropwizard.configuration.EnvironmentVariableLookup
-
- All Implemented Interfaces:
org.apache.commons.text.lookup.StringLookup
public class EnvironmentVariableLookup extends org.apache.commons.text.StrLookup<Object>
A customStrLookupimplementation using environment variables as lookup source.
-
-
Constructor Summary
Constructors Constructor Description EnvironmentVariableLookup()Create a new instance with strict behavior.EnvironmentVariableLookup(boolean strict)Create a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringlookup(String key)
-
-
-
Constructor Detail
-
EnvironmentVariableLookup
public EnvironmentVariableLookup()
Create a new instance with strict behavior.
-
EnvironmentVariableLookup
public EnvironmentVariableLookup(boolean strict)
Create a new instance.- Parameters:
strict-trueif looking up undefined environment variables should throw aUndefinedEnvironmentVariableException,falseotherwise.- Throws:
UndefinedEnvironmentVariableException- if the environment variable doesn't exist and strict behavior is enabled.
-
-
Method Detail
-
lookup
public String lookup(String key)
- Throws:
UndefinedEnvironmentVariableException- if the environment variable doesn't exist and strict behavior is enabled.
-
-