Class MultiValuesConverterFactory.AbstractConverterToMultiValues<T>

    • Constructor Detail

      • AbstractConverterToMultiValues

        public AbstractConverterToMultiValues​(ConversionService<?> conversionService)
    • Method Detail

      • convert

        public java.util.Optional<ConvertibleMultiValues> convert​(T object,
                                                                  java.lang.Class<ConvertibleMultiValues> targetType,
                                                                  ConversionContext conversionContext)
        Description copied from interface: TypeConverter
        Converts from the given source object type to the target type. Implementers should take care to return Optional.empty() in case the object is not convertible by catching any necessary exceptions and failing gracefully.
        Specified by:
        convert in interface TypeConverter<T,​ConvertibleMultiValues>
        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
      • addSeparatedValues

        protected abstract void addSeparatedValues​(ArgumentConversionContext<java.lang.Object> context,
                                                   java.lang.String name,
                                                   T object,
                                                   MutableConvertibleMultiValuesMap<java.lang.String> parameters,
                                                   java.lang.Character delimiter)
        Method that adds given value to the parameters in a format separated by a delimiter.
        Parameters:
        context - - the context of conversion which has the source type and any present annotations
        name - - the name of the parameter
        object - - the object that we are converting from
        parameters - - the parameters to the value of additional parameter will be added
        delimiter - - the required delimiter of the values in the parameter String
      • addMutliValues

        protected abstract void addMutliValues​(ArgumentConversionContext<java.lang.Object> context,
                                               java.lang.String name,
                                               T object,
                                               MutableConvertibleMultiValuesMap<java.lang.String> parameters)
        Method that adds given value to the parameters in a MULTI format.
        Parameters:
        context - - the context of conversion which has the source type and any present annotations
        name - - the name of the parameter
        object - - the object that we are converting from
        parameters - - the parameters to the value of additional parameter will be added
      • addDeepObjectValues

        protected abstract void addDeepObjectValues​(ArgumentConversionContext<java.lang.Object> context,
                                                    java.lang.String name,
                                                    T object,
                                                    MutableConvertibleMultiValuesMap<java.lang.String> parameters)
        Method that adds given value to the parameters in A DEEP_OBJECT format.
        Parameters:
        context - - the context of conversion which has the source type and any present annotations
        name - - the name of the parameter
        object - - the object that we are converting from
        parameters - - the parameters to the value of additional parameter will be added