Interface GenericMapper<ENTITY,​DTO,​MAPPER>

  • Type Parameters:
    ENTITY - the element type of the entity object
    DTO - the generic type of the data transfer object
    MAPPER - the generic type of the mapper object
    All Superinterfaces:
    BeanMapper<ENTITY,​DTO>

    public interface GenericMapper<ENTITY,​DTO,​MAPPER>
    extends BeanMapper<ENTITY,​DTO>
    The interface GenericMapper extends BeanMapper provides methods for get the mapper, the class type of entity and the dto
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Class<DTO> getDtoClass()
      Gets the data transfer object class.
      java.lang.Class<ENTITY> getEntityClass()
      Gets the entity class.
      MAPPER getMapper()
      Gets the mapper
      <D,​S>
      java.util.Collection<D>
      map​(java.util.Collection<S> sources, java.lang.Class<D> destinationClass)
      Constructs new instances of destinationClass and performs mapping between from source.
      <D,​S>
      D
      map​(S source, java.lang.Class<D> destinationClass)
      Constructs new instance of destinationClass and performs mapping between from source.
    • Method Detail

      • getMapper

        MAPPER getMapper()
        Gets the mapper
        Returns:
        the mapper
      • getDtoClass

        java.lang.Class<DTO> getDtoClass()
        Gets the data transfer object class.
        Returns:
        the data transfer object class
      • getEntityClass

        java.lang.Class<ENTITY> getEntityClass()
        Gets the entity class.
        Returns:
        the entity class
      • map

        <D,​S> java.util.Collection<D> map​(java.util.Collection<S> sources,
                                                java.lang.Class<D> destinationClass)
        Constructs new instances of destinationClass and performs mapping between from source.
        Type Parameters:
        S - the generic type of the source
        D - the generic type of the destinationClass
        Parameters:
        sources - the collection of source objects
        destinationClass - the destination class
        Returns:
        the new instance of destinationClass mapped to source object.
      • map

        <D,​S> D map​(S source,
                          java.lang.Class<D> destinationClass)
        Constructs new instance of destinationClass and performs mapping between from source.
        Type Parameters:
        S - the generic type of the source
        D - the generic type of the destinationClass
        Parameters:
        source - the source
        destinationClass - the destination class
        Returns:
        the new instance of destinationClass mapped to source object.