Interface SubjectDTOMapper
public interface SubjectDTOMapper
A mapper interface for converting between Subject domain model and its corresponding DTOs. Uses MapStruct for automatic mapping.
-
Method Summary
Modifier and TypeMethodDescriptionConverts aCreateSubjectRequest
DTO to aSubject
model.idToSubject
(Long id) MapSubject
by its unique identifier.pageSubjectToPageDTO
(Page<Subject> subjectPage) setIdsToSetSubjects
(Set<Long> ids) Map set of subject ids into set of corresponding subjects.subjectToCreateSubjectResponse
(Subject subject) Converts aSubject
model to aCreateSubjectResponse
DTO.subjectToGetSubjectResponse
(Subject subject) Converts aSubject
domain model to aGetSubjectResponse
DTO.Converts anUpdateSubjectRequest
DTO to aSubject
model.
-
Method Details
-
subjectToGetSubjectResponse
Converts aSubject
domain model to aGetSubjectResponse
DTO.- Parameters:
subject
- the subject model to convert- Returns:
- the corresponding
GetSubjectResponse
DTO
-
pageSubjectToPageDTO
- Parameters:
subjectPage
- the paginated subject entities- Returns:
- a paginated response DTO containing subject data
-
subjectToCreateSubjectResponse
Converts aSubject
model to aCreateSubjectResponse
DTO.- Parameters:
subject
- the created subject model- Returns:
- the corresponding
CreateSubjectResponse
DTO
-
updateRequestToSubject
Converts anUpdateSubjectRequest
DTO to aSubject
model.- Parameters:
request
- the DTO containing updated subject details- Returns:
- the corresponding
Subject
model
-
createRequestToSubject
Converts aCreateSubjectRequest
DTO to aSubject
model.- Parameters:
request
- the DTO containing subject creation details- Returns:
- the corresponding
Subject
model
-
idToSubject
MapSubject
by its unique identifier.- Parameters:
id
- the unique identifier- Returns:
- the corresponding
Subject
model
-
setIdsToSetSubjects
Map set of subject ids into set of corresponding subjects.
-