- Type Parameters:
T
- type of the value
- All Superinterfaces:
OptionalValue<T>
,Value<T>
- All Known Subinterfaces:
ConfigValue<T>
Config
node.
You can use accessor methods on Config
to obtain this value, such as Config.as(Class)
.
A typed value that has all the methods of Optional
- including the ones added in JDK9 and newer.
-
Method Summary
Modifier and TypeMethodDescription<N> ConfigValue
<N> as
(GenericType<N> type) Deprecated, for removal: This API element is subject to removal in a future version.Convert this value to a different type using a mapper.<N> ConfigValue
<N> Deprecated, for removal: This API element is subject to removal in a future version.Convert this value to a different type using a mapper.<N> ConfigValue
<N> Deprecated, for removal: This API element is subject to removal in a future version.Convert thisConfigValue
to a different type using a mapper function.key()
Deprecated, for removal: This API element is subject to removal in a future version.Returns the fully-qualified key of the originatingConfig
node.default String
name()
Deprecated, for removal: This API element is subject to removal in a future version.Returns the last token of the fully-qualified key for the originatingConfig
node.Deprecated, for removal: This API element is subject to removal in a future version.Returns aSupplier
of anOptional<T>
of the configuration node.supplier()
Deprecated, for removal: This API element is subject to removal in a future version.Returns a supplier of a typed value.Deprecated, for removal: This API element is subject to removal in a future version.Returns a supplier of a typed value with a default.Methods inherited from interface io.helidon.common.mapper.OptionalValue
asBoolean, asDouble, asInt, asLong, asString, get, ifPresent, ifPresentOrElse, isEmpty, isPresent, map, or, orElse, orElseGet, orElseThrow, orElseThrow
-
Method Details
-
key
Config.Key key()Deprecated, for removal: This API element is subject to removal in a future version.Returns the fully-qualified key of the originatingConfig
node.The fully-qualified key is a sequence of tokens derived from the name of each node along the path from the config root to the current node. Tokens are separated by
.
(the dot character). Seename()
for more information on the format of each token.- Returns:
- current config node key
- See Also:
-
name
Deprecated, for removal: This API element is subject to removal in a future version.Returns the last token of the fully-qualified key for the originatingConfig
node.The name of a node is the last token in its fully-qualified key.
The exact format of the name depends on the
Type
of the containing node:- from a Type#OBJECT node the token for a child is the name of the object member;
- from a Type#LIST node the token for a child is a zero-based index of the element, an unsigned base-10 integer value with no leading zeros.
The ABNF syntax of config key is:
config-key = *1( key-token *( "." key-token ) ) key-token = *( unescaped / escaped ) unescaped = %x00-2D / %x2F-7D / %x7F-10FFFF ; %x2E ('.') and %x7E ('~') are excluded from 'unescaped' escaped = "~" ( "0" / "1" ) ; representing '~' and '.', respectively
-
as
Deprecated, for removal: This API element is subject to removal in a future version.Convert thisConfigValue
to a different type using a mapper function. -
as
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:Value
Convert this value to a different type using a mapper. -
as
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:Value
Convert this value to a different type using a mapper. -
supplier
Deprecated, for removal: This API element is subject to removal in a future version.Returns a supplier of a typed value. The semantics depend on implementation, this may always return the same value, or it may provide latest value if changes are enabled.Note that
Supplier.get()
can throw aConfigException
if the value cannot be converted, or if the value is missing.- Returns:
- a supplier of a typed value
-
supplier
Deprecated, for removal: This API element is subject to removal in a future version.Returns a supplier of a typed value with a default.The semantics depend on implementation, this may always return the same value, or it may provide latest value if changes are enabled.
Note that
Supplier.get()
can throw aConfigException
if the value cannot be converted.- Parameters:
defaultValue
- a value to be returned if the supplied value represents aConfig
node that has no direct value- Returns:
- a supplier of a typed value
-
optionalSupplier
Deprecated, for removal: This API element is subject to removal in a future version.Returns aSupplier
of anOptional<T>
of the configuration node.Supplier returns a
empty
if the node does not have a direct value.
-
io.helidon.config
package instead