Class ConsulLookup
java.lang.Object
org.kiwiproject.dropwizard.consul.config.ConsulLookup
- All Implemented Interfaces:
Function<String,,String> UnaryOperator<String>,org.apache.commons.text.lookup.StringLookup
A custom
StringLookup implementation using Consul KV as
lookup source.-
Constructor Summary
ConstructorsConstructorDescriptionConsulLookup(org.kiwiproject.consul.Consul consul) Create a new instance with strict behavior.ConsulLookup(org.kiwiproject.consul.Consul consul, boolean strict) Constructor -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.text.lookup.StringLookup
apply
-
Constructor Details
-
ConsulLookup
public ConsulLookup(org.kiwiproject.consul.Consul consul) Create a new instance with strict behavior.- Parameters:
consul- Consul client
-
ConsulLookup
public ConsulLookup(org.kiwiproject.consul.Consul consul, boolean strict) Constructor- Parameters:
consul- Consul clientstrict-trueif looking up undefined environment variables should throw aUndefinedEnvironmentVariableException,falseotherwise.- Throws:
io.dropwizard.configuration.UndefinedEnvironmentVariableException- if the environment variable doesn't exist and strict behavior is enabled.
-
-
Method Details
-
lookup
- Specified by:
lookupin interfaceorg.apache.commons.text.lookup.StringLookup- Throws:
io.dropwizard.configuration.UndefinedEnvironmentVariableException- if the environment variable doesn't exist and strict behavior is enabled.
-