Class MultiValuesConverterFactory.MultiValuesToObjectConverter
java.lang.Object
io.micronaut.core.convert.converters.MultiValuesConverterFactory.MultiValuesToObjectConverter
- All Implemented Interfaces:
- FormattingTypeConverter<ConvertibleMultiValues,,- Object, - Format> - TypeConverter<ConvertibleMultiValues,- Object> 
- Enclosing class:
- MultiValuesConverterFactory
A converter to convert from 
ConvertibleMultiValues to a POJO Object.- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionconvert(ConvertibleMultiValues object, Class<Object> targetType, ConversionContext conversionContext) Implemented convert function that checks which Format is specified inside theFormatannotation If one is specified, it calls one of the corresponding abstract methods.retrieveDeepObjectValue(ArgumentConversionContext<Object> conversionContext, String name, ConvertibleMultiValues<String> parameters) Method to retrieve the values from a parameter in DEEP_OBJECT format and return in desired type.retrieveMultiValue(ArgumentConversionContext<Object> conversionContext, String name, ConvertibleMultiValues<String> parameters) Method to retrieve the values from a parameter in MULTI format and return in desired type.retrieveSeparatedValue(ArgumentConversionContext<Object> conversionContext, String name, ConvertibleMultiValues<String> parameters, String defaultValue, Character delimiter) Method to retrieve the values from a separated parameter and return the parameter in desired type.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.core.convert.TypeConverterconvert
- 
Field Details- 
conversionService
 
- 
- 
Constructor Details- 
MultiValuesToObjectConverter
 
- 
- 
Method Details- 
retrieveSeparatedValueprotected Optional<Object> retrieveSeparatedValue(ArgumentConversionContext<Object> conversionContext, String name, ConvertibleMultiValues<String> parameters, String defaultValue, Character delimiter) Method to retrieve the values from a separated parameter and return the parameter in desired type.- Parameters:
- conversionContext- the conversion context of the value to which conversion is done (including type and annotations)
- name- the name of the parameter
- parameters- all the parameters from which the parameter of given name needs to be retrieved
- defaultValue- default value
- delimiter- the delimiter of the values in the parameter String
- Returns:
- the converted value if conversion was successful
 
- 
retrieveMultiValueprotected Optional<Object> retrieveMultiValue(ArgumentConversionContext<Object> conversionContext, String name, ConvertibleMultiValues<String> parameters) Method to retrieve the values from a parameter in MULTI format and return in desired type.- Parameters:
- conversionContext- the conversion context of the value to which conversion is done (including type and annotations)
- name- the name of the parameter
- parameters- all the parameters from which the parameter of given name needs to be retrieved
- Returns:
- the converted value if conversion was successful
 
- 
retrieveDeepObjectValueprotected Optional<Object> retrieveDeepObjectValue(ArgumentConversionContext<Object> conversionContext, String name, ConvertibleMultiValues<String> parameters) Method to retrieve the values from a parameter in DEEP_OBJECT format and return in desired type.- Parameters:
- conversionContext- the conversion context of the value to which conversion is done (including type and annotations)
- name- the name of the parameter
- parameters- all the parameters from which the parameter of given name needs to be retrieved
- Returns:
- the converted value if conversion was successful
 
- 
convertpublic Optional<Object> convert(ConvertibleMultiValues object, Class<Object> targetType, ConversionContext conversionContext) Implemented convert function that checks which Format is specified inside theFormatannotation If one is specified, it calls one of the corresponding abstract methods. Otherwise, empty optional is returned- Specified by:
- convertin interface- TypeConverter<ConvertibleMultiValues,- T> 
- Parameters:
- object- The object type
- targetType- The target type being converted to
- conversionContext- The- ConversionContext
- Returns:
- The converted type or empty if the conversion is not possible
 
- 
annotationType- Specified by:
- annotationTypein interface- FormattingTypeConverter<ConvertibleMultiValues,- T, - Format> 
- Returns:
- The annotation type for this formatter
 
 
-