Interface ConverterRegistry

All Known Subinterfaces:
MutableConverterRegistry
All Known Implementing Classes:
DefaultConverterRegistry

public interface ConverterRegistry
Register of Converter
  • Method Details

    • getTargetClass

      <S, T> Class<T> getTargetClass(Class<? extends S> sourceClass)
      Looks for target type that is assigned for provided.
      Type Parameters:
      S - type of source
      T - type of target
      Parameters:
      sourceClass - source object type
      Returns:
      target class for provided source or null if no converter was found for specified source
    • getConverterForTarget

      <S, T> Converter<S,T> getConverterForTarget(Class<? extends T> targetClass)
      Looks for converter able to convert objects to provided type
      Type Parameters:
      S - type of source
      T - type of target
      Parameters:
      targetClass - target object type
      Returns:
      converter able to convert objects to provided type or null if no converter was found for specified target
    • getSourceClass

      <S, T> Class<S> getSourceClass(Class<? extends T> targetClass)
      Looks for source type that is assigned for provided.
      Type Parameters:
      S - type of source
      T - type of target
      Parameters:
      targetClass - source object type
      Returns:
      source class for provided target or null if no converter was found for specified target
    • getConverterForSource

      <S, T> Converter<S,T> getConverterForSource(Class<? extends S> sourceClass)
      Looks for converter able to convert objects from provided type
      Type Parameters:
      S - type of source
      T - type of target
      Parameters:
      sourceClass - source object type
      Returns:
      converter able to convert objects from provided type or null if no converter was found for specified source
    • getConverterParameters

      <S, T> org.apache.commons.lang3.tuple.Pair<Class<S>,Class<T>> getConverterParameters(Converter<S,T> converter)
      Gets source and target types of provided converter
      Type Parameters:
      S - type of source
      T - type of target
      Parameters:
      converter - converter to be checked
      Returns:
      <source, target> of provided converter; one, both or none side of result may be set