addMapConverters static method
Registers converters for Map types into the given ConverterRegistry.
This allows automatic conversion between maps and strings, as well as generic map-to-map transformations, using the provided ConversionService.
Example:
final registry = ConversionService();
ConversionServiceConfiguration.addMapConverters(registry);
After this, the conversion service can handle:
- Converting
StringtoMap<K, V> - Converting
Map<K, V>toString - Converting between map types (
Map<K1, V1>toMap<K2, V2>)
Implementation
static void addMapConverters(ConverterRegistry registry) {
final conversionService = registry as ConversionService;
registry.addPairedConverter(StringToMapGenericConverter(conversionService));
registry.addPairedConverter(MapToStringGenericConverter(conversionService));
registry.addPairedConverter(MapToMapGenericConverter(conversionService));
}