63 lines
1.7 KiB
Java
63 lines
1.7 KiB
Java
package eu.eudat.model.publicapi.associatedprofile;
|
|
|
|
import eu.eudat.model.DmpDescriptionTemplate;
|
|
import jakarta.xml.bind.annotation.*;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
import java.util.UUID;
|
|
|
|
@XmlRootElement(name = "profile")
|
|
@XmlAccessorType(XmlAccessType.FIELD)
|
|
public class AssociatedProfilePublicModel {
|
|
@XmlAttribute(name="profileId")
|
|
private UUID id;
|
|
@XmlAttribute(name="descriptionTemplateId")
|
|
private UUID descriptionTemplateId;
|
|
@XmlAttribute(name="label")
|
|
private String label;
|
|
@XmlElement(name="data")
|
|
private Map<String, Object> data;
|
|
|
|
public UUID getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(UUID id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public UUID getDescriptionTemplateId() {
|
|
return descriptionTemplateId;
|
|
}
|
|
|
|
public void setDescriptionTemplateId(UUID descriptionTemplateId) {
|
|
this.descriptionTemplateId = descriptionTemplateId;
|
|
}
|
|
|
|
public String getLabel() {
|
|
return label;
|
|
}
|
|
|
|
public void setLabel(String label) {
|
|
this.label = label;
|
|
}
|
|
|
|
public Map<String, Object> getData() {
|
|
return data;
|
|
}
|
|
|
|
public void setData(Map<String, Object> data) {
|
|
this.data = data;
|
|
}
|
|
|
|
public static AssociatedProfilePublicModel fromDmpDescriptionTemplate(DmpDescriptionTemplate dmpDescriptionTemplate) {
|
|
AssociatedProfilePublicModel model = new AssociatedProfilePublicModel();
|
|
model.setId(dmpDescriptionTemplate.getCurrentDescriptionTemplate().getId());
|
|
model.setDescriptionTemplateId(dmpDescriptionTemplate.getCurrentDescriptionTemplate().getId());
|
|
model.setLabel(dmpDescriptionTemplate.getCurrentDescriptionTemplate().getLabel());
|
|
model.setData(new HashMap<>());
|
|
return model;
|
|
}
|
|
}
|