Interface ConverterManager

All Known Implementing Classes:
DefaultConverterManager

public interface ConverterManager
Handle all registered converters.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the number of registered converters.
    <S, T> TypeConverter<S,T>
    getConverter(Class<S> sourceClassType, Class<T> targetClassType)
    Returns whether the Manager have converter for the given input / output type.
    <S, T> boolean
    hasConvertFor(Class<S> sourceClassType, Class<T> targetClassType)
    Returns whether the Manager have converter for the given input / output type.
    void
    registerConverter(Class<?> sourceClassType, Class<?> targetClassType, TypeConverter<?,?> converter)
    Register converter.
  • Method Details

    • hasConvertFor

      <S, T> boolean hasConvertFor(Class<S> sourceClassType, Class<T> targetClassType)
      Returns whether the Manager have converter for the given input / output type.
      Type Parameters:
      S - The source generic type
      T - The target generic type
      Parameters:
      sourceClassType - The source type class
      targetClassType - The target type class
      Returns:
      true if the manager has a matching converter, otherwise false
    • registerConverter

      void registerConverter(Class<?> sourceClassType, Class<?> targetClassType, TypeConverter<?,?> converter)
      Register converter.
      Parameters:
      sourceClassType - The source type class
      targetClassType - The target type class
      converter - The converter
    • getConverter

      <S, T> TypeConverter<S,T> getConverter(Class<S> sourceClassType, Class<T> targetClassType)
      Returns whether the Manager have converter for the given input / output type.
      Type Parameters:
      S - The source generic type
      T - The target generic type
      Parameters:
      sourceClassType - The source type class
      targetClassType - The target type class
      Returns:
      The requested converter
    • count

      int count()
      Returns the number of registered converters.
      Returns:
      The number of registered converters