Search in sources :

Example 1 with SubmissionStatusDTO

use of com.odysseusinc.arachne.portal.api.v1.dto.SubmissionStatusDTO in project ArachneCentralAPI by OHDSI.

the class SubmissionStatusHistoryToSubmissionStatusHistoryDTOConverter method convert.

@Override
public SubmissionStatusHistoryElementDTO convert(SubmissionStatusHistoryElement source) {
    Date date = source.getDate();
    SubmissionStatus status = source.getStatus();
    SubmissionStatusDTO submissionStatusDTO = null;
    if (status != null) {
        submissionStatusDTO = new SubmissionStatusDTO(status);
    }
    IUser author = source.getAuthor();
    ShortUserDTO shortUser = null;
    if (author != null) {
        shortUser = conversionService.convert(author, ShortUserDTO.class);
    }
    return new SubmissionStatusHistoryElementDTO(date, submissionStatusDTO, shortUser, source.getComment());
}
Also used : SubmissionStatus(com.odysseusinc.arachne.portal.model.SubmissionStatus) SubmissionStatusHistoryElementDTO(com.odysseusinc.arachne.portal.api.v1.dto.SubmissionStatusHistoryElementDTO) ShortUserDTO(com.odysseusinc.arachne.portal.api.v1.dto.ShortUserDTO) IUser(com.odysseusinc.arachne.portal.model.IUser) SubmissionStatusDTO(com.odysseusinc.arachne.portal.api.v1.dto.SubmissionStatusDTO) Date(java.util.Date)

Aggregations

ShortUserDTO (com.odysseusinc.arachne.portal.api.v1.dto.ShortUserDTO)1 SubmissionStatusDTO (com.odysseusinc.arachne.portal.api.v1.dto.SubmissionStatusDTO)1 SubmissionStatusHistoryElementDTO (com.odysseusinc.arachne.portal.api.v1.dto.SubmissionStatusHistoryElementDTO)1 IUser (com.odysseusinc.arachne.portal.model.IUser)1 SubmissionStatus (com.odysseusinc.arachne.portal.model.SubmissionStatus)1 Date (java.util.Date)1