Package io.quarkus.runtime.configuration
Class ConfigUtils
- java.lang.Object
-
- io.quarkus.runtime.configuration.ConfigUtils
-
public final class ConfigUtils extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classConfigUtils.BuildTimeDotEnvConfigSourceProviderSame as BuildTimeEnvConfigSource.(package private) static classConfigUtils.BuildTimeEnvConfigSourceWe override the EnvConfigSource, because we don't want the nothing back from getPropertiesNames at build time.(package private) static classConfigUtils.BuildTimeSysPropConfigSourceWe only want to include properties in the quarkus namespace.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddSourceProvider(io.smallrye.config.SmallRyeConfigBuilder builder, org.eclipse.microprofile.config.spi.ConfigSourceProvider provider)Add a configuration source provider to the builder.static voidaddSourceProviders(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.SmallRyeConfigBuilderconfigBuilder(boolean runTime, boolean bootstrap, boolean addDiscovered, LaunchMode launchMode)Get the basic configuration builder.static io.smallrye.config.SmallRyeConfigBuilderconfigBuilder(boolean runTime, boolean addDiscovered, LaunchMode launchMode)Get the basic configuration builder.static io.smallrye.config.SmallRyeConfigBuilderconfigBuilder(boolean runTime, LaunchMode launchMode)static io.smallrye.config.SmallRyeConfigBuilderemptyConfigBuilder()static booleanisPropertyPresent(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()
-
-
-
Method Detail
-
listFactory
public static <T> IntFunction<List<T>> listFactory()
-
setFactory
public static <T> IntFunction<Set<T>> setFactory()
-
sortedSetFactory
public static <T> IntFunction<SortedSet<T>> sortedSetFactory()
-
configBuilder
public static io.smallrye.config.SmallRyeConfigBuilder configBuilder(boolean runTime, LaunchMode launchMode)
-
configBuilder
public static io.smallrye.config.SmallRyeConfigBuilder configBuilder(boolean runTime, boolean addDiscovered, LaunchMode launchMode)Get the basic configuration builder.- Parameters:
runTime-trueif the configuration is run time,falseif build timeaddDiscovered-trueif the ConfigSource and Converter objects should be auto-discovered- Returns:
- the configuration builder
-
configBuilder
public static io.smallrye.config.SmallRyeConfigBuilder configBuilder(boolean runTime, boolean bootstrap, boolean addDiscovered, LaunchMode launchMode)Get the basic configuration builder.- Parameters:
runTime-trueif the configuration is run time,falseif build timeaddDiscovered-trueif the ConfigSource and Converter objects should be auto-discovered- Returns:
- the configuration builder
-
emptyConfigBuilder
public static io.smallrye.config.SmallRyeConfigBuilder emptyConfigBuilder()
-
addSourceProvider
public static void addSourceProvider(io.smallrye.config.SmallRyeConfigBuilder builder, org.eclipse.microprofile.config.spi.ConfigSourceProvider provider)Add a configuration source provider to the builder.- Parameters:
builder- the builderprovider- the provider to add
-
addSourceProviders
public static void addSourceProviders(io.smallrye.config.SmallRyeConfigBuilder builder, Collection<org.eclipse.microprofile.config.spi.ConfigSourceProvider> providers)Add a configuration source providers to the builder.- Parameters:
builder- the builderproviders- the providers to add
-
isPropertyPresent
public static boolean isPropertyPresent(String propertyName)
Checks if a property is present in the current Configuration. Because the sources may not expose the property directly inConfigSource.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.- Parameters:
propertyName- the property name.- Returns:
- true if the property is present or false otherwise.
-
-