# convert abstract method

Object? convert(

1. Class? sourceType,
2. Class targetType

)

A contract for a converter that only matches under certain conditions.

This is useful in frameworks where type conversion should occur only if some custom logic (e.g., annotations, context, runtime checks) validates it.

You can implement this interface when you want to provide more granular control over when a converter should be applied.

### 🔧 Example:

    class MyGenericNullConverter implements GenericNullConverter {
      @override
      Object? convert(Class? sourceType, Class targetType) {
        return null;
      }
    }

## Implementation

    Object? convert(Class? sourceType, Class targetType);