argos/dmp-backend/src/main/java/eu/eudat/models/dmp/AssociatedProfile.java

44 lines
1011 B
Java
Raw Normal View History

2017-12-20 15:52:09 +01:00
package eu.eudat.models.dmp;
2018-03-01 10:14:10 +01:00
import eu.eudat.utilities.interfaces.XmlSerializable;
2017-12-20 15:52:09 +01:00
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import java.util.UUID;
2018-02-01 10:08:06 +01:00
2018-02-16 11:34:02 +01:00
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");
2018-02-16 11:34:02 +01:00
profile.setAttribute("profileId", this.id.toString());
profile.setAttribute("label", this.label);
2017-12-20 15:52:09 +01:00
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;
}
}