Interface GoalMapper
public interface GoalMapper
Mapper interface for converting back and forth
from a DTO to a Goal entity.
- Since:
- 18.4.24
- Version:
- 1.0
- Author:
- Yasin M and Harry X.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionMaps Goal entity to DTOtoEntity
(GoalCreateDTO goalDTO, User user) Maps DTO to Goal entityupdateEntity
(Goal goal, GoalUpdateDTO goalDTO) Updates Goal entity based on DTO
-
Field Details
-
INSTANCE
Implementation instance of the mapper
-
-
Method Details
-
toDTO
Maps Goal entity to DTO- Parameters:
goal
- Goal entity- Returns:
- Mapped DTO
-
toEntity
Maps DTO to Goal entity- Parameters:
goalDTO
- Goal DTOuser
- User who owns the goal- Returns:
- Mapped entity
-
updateEntity
Updates Goal entity based on DTO- Parameters:
goal
- Goal entity that is updatedgoalDTO
- Goal DTO with new changes- Returns:
- Updated goal entity
-