46 lines
1.1 KiB
Java
46 lines
1.1 KiB
Java
package eu.eudat.models.data.rda;
|
|
|
|
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()) {
|
|
this.contact_id = new ContactIdRDAExportModel();
|
|
this.contact_id.setContact_id(entity.getId().toString());
|
|
}
|
|
else {
|
|
this.contact_id = null;
|
|
}
|
|
return this;
|
|
}
|
|
}
|