23 lines
530 B
Java
23 lines
530 B
Java
package eu.eudat.file.transformer.model.rda.mapper;
|
|
|
|
import eu.eudat.file.transformer.model.rda.ContactId;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import java.util.UUID;
|
|
|
|
@Component
|
|
public class ContactIdRDAMapper {
|
|
|
|
public ContactId toRDA(UUID id) {
|
|
if (id == null) return null;
|
|
ContactId rda = new ContactId();
|
|
rda.setIdentifier(id.toString());
|
|
rda.setType(ContactId.Type.OTHER);
|
|
return rda;
|
|
}
|
|
|
|
public UUID toModel(ContactId rda) {
|
|
return rda == null ? null : UUID.fromString(rda.getIdentifier());
|
|
}
|
|
}
|