2019-10-11 15:39:29 +02:00
|
|
|
package eu.eudat.models.data.rda;
|
2019-06-04 16:04:04 +02:00
|
|
|
|
|
|
|
import eu.eudat.data.entities.UserInfo;
|
|
|
|
|
|
|
|
public class ContactRDAExportModel {
|
|
|
|
private String mail;
|
|
|
|
private String name;
|
|
|
|
private ContactIdRDAExportModel contact_id;
|
|
|
|
|
|
|
|
public String getMail() {
|
|
|
|
return mail;
|
|
|
|
}
|
|
|
|
public void setMail(String mail) {
|
|
|
|
this.mail = mail;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getName() {
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
public void setName(String name) {
|
|
|
|
this.name = name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ContactIdRDAExportModel getContact_id() {
|
|
|
|
return contact_id;
|
|
|
|
}
|
|
|
|
public void setContact_id(ContactIdRDAExportModel contact_id) {
|
|
|
|
this.contact_id = contact_id;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public ContactRDAExportModel fromDataModel(UserInfo entity) {
|
|
|
|
this.mail = entity.getEmail();
|
|
|
|
this.name = entity.getName();
|
|
|
|
// TODO: we should use a contact_id and not our UUID.
|
|
|
|
if (!entity.getId().toString().isEmpty()) {
|
2019-10-15 12:46:49 +02:00
|
|
|
this.contact_id = new ContactIdRDAExportModel(entity.getId().toString(), "argos_internal");
|
2019-06-04 16:04:04 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
this.contact_id = null;
|
|
|
|
}
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
}
|