Class MultiValuesConverterFactory.MultiValuesToObjectConverter
- java.lang.Object
-
- io.micronaut.core.convert.converters.MultiValuesConverterFactory.MultiValuesToObjectConverter
-
- All Implemented Interfaces:
FormattingTypeConverter<ConvertibleMultiValues,java.lang.Object,Format>
,TypeConverter<ConvertibleMultiValues,java.lang.Object>
- Enclosing class:
- MultiValuesConverterFactory
public static class MultiValuesConverterFactory.MultiValuesToObjectConverter extends java.lang.Object
A converter to convert fromConvertibleMultiValues
to a POJOObject
.
-
-
Constructor Summary
Constructors Constructor Description MultiValuesToObjectConverter(ConversionService<?> conversionService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Optional<java.lang.Object>
retrieveDeepObjectValue(ArgumentConversionContext<java.lang.Object> conversionContext, java.lang.String name, ConvertibleMultiValues<java.lang.String> parameters)
Method to retrieve the values from a parameter in DEEP_OBJECT format and return in desired type.protected java.util.Optional<java.lang.Object>
retrieveMultiValue(ArgumentConversionContext<java.lang.Object> conversionContext, java.lang.String name, ConvertibleMultiValues<java.lang.String> parameters)
Method to retrieve the values from a parameter in MULTI format and return in desired type.protected java.util.Optional<java.lang.Object>
retrieveSeparatedValue(ArgumentConversionContext<java.lang.Object> conversionContext, java.lang.String name, ConvertibleMultiValues<java.lang.String> parameters, java.lang.String defaultValue, java.lang.Character delimiter)
Method to retrieve the values from a separated parameter and return the parameter in desired type.-
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.TypeConverter
convert
-
-
-
-
Constructor Detail
-
MultiValuesToObjectConverter
public MultiValuesToObjectConverter(ConversionService<?> conversionService)
-
-
Method Detail
-
retrieveSeparatedValue
protected java.util.Optional<java.lang.Object> retrieveSeparatedValue(ArgumentConversionContext<java.lang.Object> conversionContext, java.lang.String name, ConvertibleMultiValues<java.lang.String> parameters, java.lang.String defaultValue, java.lang.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 parameterparameters
- all the parameters from which the parameter of given name needs to be retrieveddefaultValue
- default valuedelimiter
- the delimiter of the values in the parameter String- Returns:
- the converted value if conversion was successful
-
retrieveMultiValue
protected java.util.Optional<java.lang.Object> retrieveMultiValue(ArgumentConversionContext<java.lang.Object> conversionContext, java.lang.String name, ConvertibleMultiValues<java.lang.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 parameterparameters
- all the parameters from which the parameter of given name needs to be retrieved- Returns:
- the converted value if conversion was successful
-
retrieveDeepObjectValue
protected java.util.Optional<java.lang.Object> retrieveDeepObjectValue(ArgumentConversionContext<java.lang.Object> conversionContext, java.lang.String name, ConvertibleMultiValues<java.lang.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 parameterparameters
- all the parameters from which the parameter of given name needs to be retrieved- Returns:
- the converted value if conversion was successful
-
-