Interface GenericMapper<ENTITY,​DTO>

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

    public interface GenericMapper<ENTITY,​DTO>
    extends BeanMapper<ENTITY,​DTO>
    The Interface GenericMapper provides the methods for mapping entities to data transfer objects and back.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <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

      • 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.