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

46 lines
1.0 KiB
Java

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>{
private UUID id;
private String label;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
@Override
public Element toXml(Document doc) {
Element profile = doc.createElement("profile");
profile.setAttribute("profileId",this.id.toString());
profile.setAttribute("label",this.label);
return profile;
}
@Override
public AssociatedProfile fromXml(Element item) {
this.id = UUID.fromString(item.getAttribute("profileId"));
this.label = item.getAttribute("label");
return this;
}
}