Interface ConfigurableConverter<SOURCE,TARGET,OPTION>

Type Parameters:
SOURCE - the type of the source object
TARGET - the type of the destination object
OPTION - the type of the options list
All Superinterfaces:
Converter<SOURCE,TARGET>, org.springframework.core.convert.converter.Converter<SOURCE,TARGET>
All Known Subinterfaces:
ConfigurableSubtypeConverter<SOURCE,TARGET,OPTION>
All Known Implementing Classes:
DefaultConfigurableConverter, DefaultConfigurableSubtypeAwareConverter, DefaultConfigurableSubtypeConverter

public interface ConfigurableConverter<SOURCE,TARGET,OPTION> extends Converter<SOURCE,TARGET>
Interface for a configurable converter. The collection of options is used to control what data is populated.
  • Method Details

    • convert

      default TARGET convert(SOURCE source)
      Description copied from interface: Converter
      Converts the source object, creating a new instance of the destination type
      Specified by:
      convert in interface Converter<SOURCE,TARGET>
      Specified by:
      convert in interface org.springframework.core.convert.converter.Converter<SOURCE,TARGET>
      Parameters:
      source - the source object
      Returns:
      the converted object
    • convert

      default TARGET convert(SOURCE source, TARGET prototype)
      Description copied from interface: Converter
      Convert the source object by filling the prototype
      Specified by:
      convert in interface Converter<SOURCE,TARGET>
      Parameters:
      source - the source object
      prototype - the prototype to fill
      Returns:
      the converted object, identical to the prototype
    • convert

      default TARGET convert(SOURCE source, Collection<OPTION> options)
      Converts a SOURCE object into a TARGET object using provided Options.
      Parameters:
      source - - the source object
      options - - the collection of convert options
      Returns:
      the TARGET object
      Throws:
      ConversionException - when an error occurs during the conversion process
    • convert

      TARGET convert(SOURCE source, TARGET target, Collection<OPTION> options)
      Converts a SOURCE object into a TARGET object using provided Options.
      Parameters:
      source - - the source object
      target - - the target object
      options - - the collection of convert options
      Returns:
      the TARGET object
      Throws:
      ConversionException - when an error occurs during the conversion process
    • convertAll

      default List<TARGET> convertAll(Collection<? extends SOURCE> sources, OPTION... options)
      Converts a Collection SOURCE objects into a List of TARGET objects using provided as array Options.
      Parameters:
      sources - - the source objects
      options - - the array of convert options
      Returns:
      the List of TARGET objects
      Throws:
      ConversionException - when an error occurs during the conversion process
    • convertAll

      default List<TARGET> convertAll(Collection<? extends SOURCE> sources, Collection<OPTION> options)
      Converts a Collection of SOURCE objects into a List of TARGET objects using provided as Collection Options.
      Parameters:
      sources - - the source objects
      options - - the array of convert options
      Returns:
      the List of TARGET objects
      Throws:
      ConversionException - when an error occurs during the conversion process
    • getTargetInstance

      TARGET getTargetInstance(SOURCE source)
      Getting target instance of source object
      Parameters:
      source - - the source object
      Returns:
      the TARGET object
    • getDefaultOptions

      Collection<OPTION> getDefaultOptions()
      Getting default options
      Returns:
      the Collection of Options