java.lang.Object
no.ntnu.principes.mapper.TaskMapper
Maps Task domain objects to TaskDto objects for use in the presentation layer.
Provides methods for mapping individual tasks and collections of tasks.
Uses batch loading for related entities when mapping multiple tasks.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
TaskMapper
public TaskMapper()
-
-
Method Details
-
mapTask
Maps a single Task to its DTO representation. Fetches the creator's profile information and initializes assignments as empty.- Parameters:
task- The task domain object to be mapped- Returns:
- The mapped TaskDto with creator information
-
mapTasks
Maps a list of Tasks to their DTO representations with optimized data loading. Prefetches all creator profiles in a single batch operation to avoid multiple database queries. Initializes assignment lists as empty for each task.- Parameters:
tasks- The list of task domain objects to be mapped- Returns:
- A list of mapped TaskDto objects with creator information
-