public final class ConfigUtils extends Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
ConfigUtils.BuildTimeDotEnvConfigSourceProvider
Same as BuildTimeEnvConfigSource.
|
(package private) static class |
ConfigUtils.BuildTimeEnvConfigSource
We override the EnvConfigSource, because we don't want the nothing back from getPropertiesNames at build time.
|
(package private) static class |
ConfigUtils.BuildTimeSysPropConfigSource
We only want to include properties in the quarkus namespace.
|
Modifier and Type | Method and Description |
---|---|
static void |
addSourceProvider(io.smallrye.config.SmallRyeConfigBuilder builder,
org.eclipse.microprofile.config.spi.ConfigSourceProvider provider)
Add a configuration source provider to the builder.
|
static void |
addSourceProviders(io.smallrye.config.SmallRyeConfigBuilder builder,
Collection<org.eclipse.microprofile.config.spi.ConfigSourceProvider> providers)
Add a configuration source providers to the builder.
|
static io.smallrye.config.SmallRyeConfigBuilder |
configBuilder(boolean runTime) |
static io.smallrye.config.SmallRyeConfigBuilder |
configBuilder(boolean runTime,
boolean addDiscovered)
Get the basic configuration builder.
|
static boolean |
isPropertyPresent(String propertyName)
Checks if a property is present in the current Configuration.
|
static <T> IntFunction<List<T>> |
listFactory() |
static <T> IntFunction<Set<T>> |
setFactory() |
static <T> IntFunction<SortedSet<T>> |
sortedSetFactory() |
public static <T> IntFunction<List<T>> listFactory()
public static <T> IntFunction<Set<T>> setFactory()
public static <T> IntFunction<SortedSet<T>> sortedSetFactory()
public static io.smallrye.config.SmallRyeConfigBuilder configBuilder(boolean runTime)
public static io.smallrye.config.SmallRyeConfigBuilder configBuilder(boolean runTime, boolean addDiscovered)
runTime
- true
if the configuration is run time, false
if build timeaddDiscovered
- true
if the ConfigSource and Converter objects should be auto-discoveredpublic static void addSourceProvider(io.smallrye.config.SmallRyeConfigBuilder builder, org.eclipse.microprofile.config.spi.ConfigSourceProvider provider)
builder
- the builderprovider
- the provider to addpublic static void addSourceProviders(io.smallrye.config.SmallRyeConfigBuilder builder, Collection<org.eclipse.microprofile.config.spi.ConfigSourceProvider> providers)
builder
- the builderproviders
- the providers to addpublic static boolean isPropertyPresent(String propertyName)
ConfigSource.getPropertyNames()
, we cannot
reliable determine if the property is present in the properties list. The property needs to be retrieved to make
sure it exists. Also, if the value is an expression, we want to ignore expansion, because this is not relevant
for the check and the expansion value may not be available at this point.
It may be interesting to expose such API in SmallRyeConfig directly.propertyName
- the property name.Copyright © 2021 JBoss by Red Hat. All rights reserved.