# registerConverters static method

void registerConverters(

1. Set? converters,
2. ConverterRegistry registry

)

Utility class for registering a set of converters with a ConverterRegistry.

This is used to bulk-register multiple converter objects, whether they implement Converter, ConverterFactory, or PairedConverter.

All converters are matched by type and registered accordingly. If any object in the provided set does not implement one of the recognized interfaces, an IllegalArgumentException is thrown.

### 🔧 Example

    final registry = DefaultConverterRegistry();
    ConversionServiceFactory.registerConverters({
      StringToIntConverter(),
      StringToDateTimeConverter(),
      StringToEnumConverterFactory(),
      MyGenericConverter(),
    }, registry);

Registers each converter in `converters` with the provided `registry`.

- If a converter is a PairedConverter, it will be registered using ConverterRegistry.addPairedConverter.
- If it is a Converter, it will be registered using ConverterRegistry.addConverter.
- If it is a ConverterFactory, it will be registered using ConverterRegistry.addConverterFactory.

Throws IllegalArgumentException if any object in `converters` does not implement one of these types.

## Implementation

    static void registerConverters(Set<dynamic>? converters, ConverterRegistry registry) {
      if (converters != null) {
        for (Object candidate in converters) {
          if (candidate is PairedConverter) {
            registry.addPairedConverter(candidate);
          } else if (candidate is Converter<dynamic, dynamic>) {
            registry.addConverter(candidate);
          } else if (candidate is ConverterFactory<dynamic, dynamic>) {
            registry.addConverterFactory(candidate);
          } else {
            throw IllegalArgumentException(
              "Each converter object must implement one of the "
              "Converter, ConverterFactory, or PairedConverter interfaces",
            );
          }
        }
      }
    }