Package io.micronaut.json.convert
Class JsonNodeConvertibleValues<V>
java.lang.Object
io.micronaut.json.convert.JsonNodeConvertibleValues<V>
- Type Parameters:
V
- The generic type for values
- All Implemented Interfaces:
ConversionServiceProvider
,ConvertibleValues<V>
,ValueResolver<CharSequence>
,Iterable<Map.Entry<String,
V>>
Simple facade over a
JsonNode
to make it a ConvertibleValues
.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Fields inherited from interface io.micronaut.core.convert.value.ConvertibleValues
EMPTY
-
Constructor Summary
ConstructorDescriptionJsonNodeConvertibleValues
(JsonNode objectNode, ConversionService conversionService) -
Method Summary
Modifier and TypeMethodDescription<T> Optional<T>
get
(CharSequence name, ArgumentConversionContext<T> conversionContext) Resolve the given property for the given name.Provides the conversion service.names()
values()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.core.convert.value.ConvertibleValues
asMap, asMap, asProperties, contains, forEach, getValue, getValueType, isEmpty, iterator, subMap, subMap, subMap
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface io.micronaut.core.value.ValueResolver
get, get, get
-
Constructor Details
-
JsonNodeConvertibleValues
- Parameters:
objectNode
- The node that maps to JSON object structureconversionService
- To convert the JSON node into given type
-
-
Method Details
-
names
- Specified by:
names
in interfaceConvertibleValues<V>
- Returns:
- The names of the values
-
values
- Specified by:
values
in interfaceConvertibleValues<V>
- Returns:
- The values
-
get
Description copied from interface:ValueResolver
Resolve the given property for the given name.- Specified by:
get
in interfaceValueResolver<V>
- Type Parameters:
T
- The concrete type- Parameters:
name
- The nameconversionContext
- The conversion context- Returns:
- An optional containing the property value if it exists and is able to be converted
-
getConversionService
Description copied from interface:ConversionServiceProvider
Provides the conversion service.- Specified by:
getConversionService
in interfaceConversionServiceProvider
- Specified by:
getConversionService
in interfaceConvertibleValues<V>
- Returns:
- the conversion service
-