public class SmallRyeConfig extends Object implements org.eclipse.microprofile.config.Config, Serializable
| Modifier | Constructor and Description |
|---|---|
protected |
SmallRyeConfig(List<org.eclipse.microprofile.config.spi.ConfigSource> configSources,
Map<Type,org.eclipse.microprofile.config.spi.Converter<?>> converters)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConfigSource(org.eclipse.microprofile.config.spi.ConfigSource configSource)
Deprecated.
|
<T> T |
convert(String value,
Class<T> asType) |
<T> T |
getConfigMapping(Class<T> type) |
<T> T |
getConfigMapping(Class<T> type,
String prefix) |
ConfigMappings |
getConfigMappings() |
Iterable<org.eclipse.microprofile.config.spi.ConfigSource> |
getConfigSources() |
ConfigValue |
getConfigValue(String name) |
<T> org.eclipse.microprofile.config.spi.Converter<T> |
getConverter(Class<T> asType) |
<T,C extends Collection<T>> |
getIndexedOptionalValues(String name,
org.eclipse.microprofile.config.spi.Converter<T> converter,
IntFunction<C> collectionFactory) |
List<String> |
getIndexedProperties(String property) |
List<Integer> |
getIndexedPropertiesIndexes(String property) |
<T,C extends Collection<T>> |
getIndexedValues(String name,
org.eclipse.microprofile.config.spi.Converter<T> converter,
IntFunction<C> collectionFactory) |
<T> Optional<T> |
getOptionalValue(String name,
Class<T> aClass) |
<T> Optional<T> |
getOptionalValue(String name,
org.eclipse.microprofile.config.spi.Converter<T> converter) |
<T> Optional<List<T>> |
getOptionalValues(String propertyName,
Class<T> propertyType) |
<T,C extends Collection<T>> |
getOptionalValues(String name,
Class<T> itemClass,
IntFunction<C> collectionFactory) |
<T,C extends Collection<T>> |
getOptionalValues(String name,
org.eclipse.microprofile.config.spi.Converter<T> converter,
IntFunction<C> collectionFactory) |
List<String> |
getProfiles() |
Iterable<String> |
getPropertyNames() |
String |
getRawValue(String name)
Get the raw value of a configuration property.
|
<T> T |
getValue(String name,
Class<T> aClass) |
<T> T |
getValue(String name,
org.eclipse.microprofile.config.spi.Converter<T> converter)
This method handles calls from both
Config.getValue(java.lang.String, java.lang.Class<T>) and Config.getOptionalValue(java.lang.String, java.lang.Class<T>).Calls from Config.getValue(java.lang.String, java.lang.Class<T>) should throw an Exception for each of the following:1. |
<T> List<T> |
getValues(String propertyName,
Class<T> propertyType) |
<T,C extends Collection<T>> |
getValues(String name,
Class<T> itemClass,
IntFunction<C> collectionFactory) |
<T,C extends Collection<T>> |
getValues(String name,
org.eclipse.microprofile.config.spi.Converter<T> converter,
IntFunction<C> collectionFactory) |
boolean |
rawValueEquals(String name,
String expected)
Determine whether the raw value of a configuration property is exactly equal to the expected given
value.
|
@Deprecated protected SmallRyeConfig(List<org.eclipse.microprofile.config.spi.ConfigSource> configSources, Map<Type,org.eclipse.microprofile.config.spi.Converter<?>> converters)
public <T,C extends Collection<T>> C getValues(String name, Class<T> itemClass, IntFunction<C> collectionFactory)
public <T,C extends Collection<T>> C getValues(String name, org.eclipse.microprofile.config.spi.Converter<T> converter, IntFunction<C> collectionFactory)
public <T,C extends Collection<T>> C getIndexedValues(String name, org.eclipse.microprofile.config.spi.Converter<T> converter, IntFunction<C> collectionFactory)
public <T> T getValue(String name, Class<T> aClass)
getValue in interface org.eclipse.microprofile.config.Configpublic <T> T getValue(String name, org.eclipse.microprofile.config.spi.Converter<T> converter)
Config.getValue(java.lang.String, java.lang.Class<T>) and Config.getOptionalValue(java.lang.String, java.lang.Class<T>).Config.getValue(java.lang.String, java.lang.Class<T>) should throw an Exception for each of the following:IllegalArgumentException - if the property cannot be converted by the Converter to the specified type
NoSuchElementException - if the property is not defined NoSuchElementException - if the property is defined as an empty string NoSuchElementException - if the Converter returns null Config.getOptionalValue(java.lang.String, java.lang.Class<T>) should only throw an Exception for #1
(IllegalArgumentException when the property cannot be converted to the specified type).public boolean rawValueEquals(String name, String expected)
name - the property name (must not be null)expected - the expected value (may be null)true if the values are equal, false otherwise@Experimental(value="Extension to the original ConfigSource to allow retrieval of additional metadata on config lookup") public ConfigValue getConfigValue(String name)
public String getRawValue(String name)
name - the property name (must not be null)null if no property value was discovered for the given property namepublic <T> Optional<T> getOptionalValue(String name, Class<T> aClass)
getOptionalValue in interface org.eclipse.microprofile.config.Configpublic <T> Optional<T> getOptionalValue(String name, org.eclipse.microprofile.config.spi.Converter<T> converter)
public <T> Optional<List<T>> getOptionalValues(String propertyName, Class<T> propertyType)
public <T,C extends Collection<T>> Optional<C> getOptionalValues(String name, Class<T> itemClass, IntFunction<C> collectionFactory)
public <T,C extends Collection<T>> Optional<C> getOptionalValues(String name, org.eclipse.microprofile.config.spi.Converter<T> converter, IntFunction<C> collectionFactory)
public <T,C extends Collection<T>> Optional<C> getIndexedOptionalValues(String name, org.eclipse.microprofile.config.spi.Converter<T> converter, IntFunction<C> collectionFactory)
public ConfigMappings getConfigMappings()
@Experimental(value="ConfigMapping API to group configuration properties") public <T> T getConfigMapping(Class<T> type)
@Experimental(value="ConfigMapping API to group configuration properties") public <T> T getConfigMapping(Class<T> type, String prefix)
public Iterable<String> getPropertyNames()
getPropertyNames in interface org.eclipse.microprofile.config.Configpublic Iterable<org.eclipse.microprofile.config.spi.ConfigSource> getConfigSources()
getConfigSources in interface org.eclipse.microprofile.config.Config@Deprecated public void addConfigSource(org.eclipse.microprofile.config.spi.ConfigSource configSource)
SmallRyeConfigBuilder.withWrapper(UnaryOperator) will not be applied.configSource - the new config source (must not be null)public <T> org.eclipse.microprofile.config.spi.Converter<T> getConverter(Class<T> asType)
Copyright © 2018–2021. All rights reserved.