Interface MapperProvider

  • All Known Implementing Classes:
    DbClientMapperProvider
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface MapperProvider
    Java Service loader service to get mappers.
    • Method Detail

      • mapper

        <SOURCE,​TARGET> Optional<Mapper<?,​?>> mapper​(Class<SOURCE> sourceClass,
                                                                 Class<TARGET> targetClass)
        Find a mapper that is capable of mapping from source to target classes.
        Type Parameters:
        SOURCE - type of the source
        TARGET - type of the target
        Parameters:
        sourceClass - class of the source
        targetClass - class of the target
        Returns:
        a mapper that is capable of mapping (or converting) sources to targets
      • mapper

        default <SOURCE,​TARGET> Optional<Mapper<?,​?>> mapper​(GenericType<SOURCE> sourceType,
                                                                         GenericType<TARGET> targetType)
        Find a mapper that is capable of mapping from source to target types. This method supports mapping to/from types that contain generics.
        Type Parameters:
        SOURCE - type of the source
        TARGET - type of the target
        Parameters:
        sourceType - generic type of the source
        targetType - generic type of the target
        Returns:
        a mapper that is capable of mapping (or converting) sources to targets