Interface BeanMapper<ENTITY,​DTO>

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

    public interface BeanMapper<ENTITY,​DTO>
    The Interface BeanMapper 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
      DTO toDto​(ENTITY entity)
      Maps the given entity object to a data transfer object
      java.util.List<DTO> toDtos​(java.util.Collection<ENTITY> entities)
      Maps the given collection of entity objects to a list of data transfer objects
      java.util.List<ENTITY> toEntities​(java.util.Collection<DTO> dtos)
      Maps the given list of data transfer objects to a list of entity objects
      ENTITY toEntity​(DTO dto)
      Maps the given data transfer object to a entity object.
    • Method Detail

      • toDto

        DTO toDto​(ENTITY entity)
        Maps the given entity object to a data transfer object
        Parameters:
        entity - the entity object
        Returns:
        the data transfer object
      • toDtos

        java.util.List<DTO> toDtos​(java.util.Collection<ENTITY> entities)
        Maps the given collection of entity objects to a list of data transfer objects
        Parameters:
        entities - the collection of entities objects
        Returns:
        the list of data transfer objects
      • toEntities

        java.util.List<ENTITY> toEntities​(java.util.Collection<DTO> dtos)
        Maps the given list of data transfer objects to a list of entity objects
        Parameters:
        dtos - the list of data transfer objects
        Returns:
        the list of entity objects.
      • toEntity

        ENTITY toEntity​(DTO dto)
        Maps the given data transfer object to a entity object.
        Parameters:
        dto - the data transfer object
        Returns:
        the entity object