Interface MutableConversionService

All Superinterfaces:
ConversionService
All Known Subinterfaces:
Environment
All Known Implementing Classes:
DefaultEnvironment, DefaultMutableConversionService

public interface MutableConversionService extends ConversionService
A version of ConversionService that supports adding new converters.
Since:
4.0.0
Author:
Denis Stepanov
  • Method Details

    • create

      Creates a new mutable conversion service that extends the shared conversion service. In most cases the mutable service from the bean context should be used.
      Returns:
      A new mutable conversion service.
    • addConverter

      <S, T> void addConverter(@NonNull @NonNull Class<S> sourceType, @NonNull @NonNull Class<T> targetType, @NonNull @NonNull Function<S,T> typeConverter)
      Adds a type converter.
      Type Parameters:
      S - The source generic type
      T - The target generic type
      Parameters:
      sourceType - The source type
      targetType - The target type
      typeConverter - The type converter
    • addConverter

      <S, T> void addConverter(@NonNull @NonNull Class<S> sourceType, @NonNull @NonNull Class<T> targetType, @NonNull @NonNull TypeConverter<S,T> typeConverter)
      Adds a type converter.
      Type Parameters:
      S - The source generic type
      T - The target generic type
      Parameters:
      sourceType - The source type
      targetType - The target type
      typeConverter - The type converter