2017-12-20 15:52:09 +01:00
|
|
|
package eu.eudat.models.dmp;
|
|
|
|
|
|
|
|
import eu.eudat.utilities.XmlSerializable;
|
|
|
|
import org.w3c.dom.Document;
|
|
|
|
import org.w3c.dom.Element;
|
|
|
|
|
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Created by ikalyvas on 12/20/2017.
|
|
|
|
*/
|
|
|
|
public class AssociatedProfile implements XmlSerializable<AssociatedProfile>{
|
2017-12-22 09:31:05 +01:00
|
|
|
private UUID id;
|
2017-12-20 15:52:09 +01:00
|
|
|
private String label;
|
|
|
|
|
2017-12-22 09:31:05 +01:00
|
|
|
public UUID getId() {
|
|
|
|
return id;
|
2017-12-20 15:52:09 +01:00
|
|
|
}
|
|
|
|
|
2017-12-22 09:31:05 +01:00
|
|
|
public void setId(UUID id) {
|
|
|
|
this.id = id;
|
2017-12-20 15:52:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public String getLabel() {
|
|
|
|
return label;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setLabel(String label) {
|
|
|
|
this.label = label;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Element toXml(Document doc) {
|
|
|
|
Element profile = doc.createElement("profile");
|
2017-12-22 09:31:05 +01:00
|
|
|
profile.setAttribute("profileId",this.id.toString());
|
2017-12-20 15:52:09 +01:00
|
|
|
profile.setAttribute("label",this.label);
|
|
|
|
return profile;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public AssociatedProfile fromXml(Element item) {
|
2017-12-22 09:31:05 +01:00
|
|
|
this.id = UUID.fromString(item.getAttribute("profileId"));
|
2017-12-20 15:52:09 +01:00
|
|
|
this.label = item.getAttribute("label");
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
}
|