Class AbstractMapper<T,​DTO extends IHasPrimaryKey<T>,​ENTITY extends IHasPrimaryKey<T>>

    • Constructor Detail

      • AbstractMapper

        public AbstractMapper()
    • Method Detail

      • convertToDto

        protected abstract DTO convertToDto​(ENTITY entity)
        convert dto to entity for specific object
        Parameters:
        entity - transform entity to dto
        Returns:
        type of DTO
      • convertToEntity

        protected abstract ENTITY convertToEntity​(DTO dto)
        convert dto to entity for specific object
        Parameters:
        dto - transform dto to entity
        Returns:
        type of ENTITY
      • toDTO

        public DTO toDTO​(ENTITY obj)
        convert entity to dto for specific object
        Parameters:
        obj - object for transform
        Returns:
        type of DTO
      • toEntity

        public ENTITY toEntity​(DTO obj)
        convert dto to entity for specific object
        Parameters:
        obj - object for transform
        Returns:
        type of ENTITY
      • convertList2Dto

        public List<DTO> convertList2Dto​(List<ENTITY> list)
        convert list of ENTITY to list of DTO for specific object
        Parameters:
        list - object for transform
        Returns:
        type of DTO list
      • convertList2Entity

        public List<ENTITY> convertList2Entity​(List<DTO> list)
        convert list of DTO to list of ENTITY for specific object
        Parameters:
        list - object for transform
        Returns:
        type of ENTITY List