| Modifier and Type | Method and Description |
|---|---|
<T> List<T> |
asList(String propertyName,
Class<T> typeArg)
Return value as a
List of values. |
Map<String,String> |
asMap()
Get all properties of this config as a map.
|
<T> Set<T> |
asSet(String propertyName,
Class<T> typeArg)
Return value as a
Set of values. |
static MpConfigBuilder |
builder()
Get a builder for config instances.
|
<T> T |
convert(Class<T> type,
String value)
Try to coerce the value to the specific type.
|
Iterable<ConfigSource> |
getConfigSources() |
<T> Optional<T> |
getOptionalValue(String propertyName,
Class<T> propertyType) |
Iterable<String> |
getPropertyNames() |
<T> T |
getValue(String propertyName,
Class<T> propertyType) |
boolean |
hasConverter(Class<?> clazz)
Check whether a converter exists for a specific class.
|
Config |
helidonConfig()
Get an instance of Helidon config (a tree structure) rather than the microprofile config.
|
String |
toString() |
<T> T |
value(String propertyName,
Class<T> propertyType,
T defaultValue)
Get value with a default if it does not exist.
|
<T> T |
valueWithDefault(String propertyName,
Class<T> propertyType,
String defaultValue)
Get value with a default if it does not exist.
|
public static MpConfigBuilder builder()
public <T> Set<T> asSet(String propertyName, Class<T> typeArg)
Set of values.T - type of elementspropertyName - name of propertytypeArg - type of elements in the setpublic <T> List<T> asList(String propertyName, Class<T> typeArg)
List of values.T - type of elementspropertyName - name of propertytypeArg - type of elements in the listpublic <T> T value(String propertyName, Class<T> propertyType, T defaultValue)
T - type of the propertypropertyName - name of the propertypropertyType - type of the propertydefaultValue - default value correctly typedpublic <T> T valueWithDefault(String propertyName, Class<T> propertyType, String defaultValue)
T - type of the propertypropertyName - name of the propertypropertyType - type of the propertydefaultValue - default value as Stringpublic <T> Optional<T> getOptionalValue(String propertyName, Class<T> propertyType)
getOptionalValue in interface Configpublic Iterable<String> getPropertyNames()
getPropertyNames in interface Configpublic Iterable<ConfigSource> getConfigSources()
getConfigSources in interface Configpublic boolean hasConverter(Class<?> clazz)
clazz - class to convert totrue if a converter exists for the specified classpublic <T> T convert(Class<T> type, String value)
T - type we expect (e.g. String, Integer or a java bean)type - type to returnvalue - string value to parseIllegalArgumentException - if the value cannot be converted to the specified type using.public Config helidonConfig()
public Map<String,String> asMap()
Copyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.