001package co.codewizards.cloudstore.local.dto;
002
003import static co.codewizards.cloudstore.core.objectfactory.ObjectFactoryUtil.*;
004import co.codewizards.cloudstore.core.dto.DeleteModificationDto;
005import co.codewizards.cloudstore.local.persistence.DeleteModification;
006
007public class DeleteModificationDtoConverter {
008
009        protected DeleteModificationDtoConverter() {
010        }
011
012        public static DeleteModificationDtoConverter create() {
013                return createObject(DeleteModificationDtoConverter.class);
014        }
015
016        public DeleteModificationDto toDeleteModificationDto(DeleteModification deleteModification) {
017                final DeleteModificationDto dto = createObject(DeleteModificationDto.class);
018                dto.setId(deleteModification.getId());
019                dto.setLocalRevision(deleteModification.getLocalRevision());
020
021                // *Warning* This path is overwritten with the *unprefixed* path, before being sent to the server.
022                dto.setPath(deleteModification.getPath());
023                return dto;
024        }
025}