128 lines
3.1 KiB
Java
128 lines
3.1 KiB
Java
package eu.eudat.models.data.dataset;
|
|
|
|
import eu.eudat.data.entities.Dataset;
|
|
import eu.eudat.models.DataModel;
|
|
import eu.eudat.models.data.datasetprofile.DatasetProfileOverviewModel;
|
|
import eu.eudat.models.data.listingmodels.UserInfoListingModel;
|
|
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.UUID;
|
|
import java.util.stream.Collectors;
|
|
|
|
public class DatasetOverviewModel implements DataModel<Dataset, DatasetOverviewModel> {
|
|
|
|
private UUID id;
|
|
private String label;
|
|
private short status;
|
|
private DatasetProfileOverviewModel datasetTemplate;
|
|
private List<UserInfoListingModel> users;
|
|
private String dmp;
|
|
private String grant;
|
|
private String description;
|
|
private Boolean isPublic;
|
|
private Date modified;
|
|
|
|
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;
|
|
}
|
|
|
|
public short getStatus() {
|
|
return status;
|
|
}
|
|
public void setStatus(short status) {
|
|
this.status = status;
|
|
}
|
|
|
|
public DatasetProfileOverviewModel getDatasetTemplate() {
|
|
return datasetTemplate;
|
|
}
|
|
public void setDatasetTemplate(DatasetProfileOverviewModel datasetTemplate) {
|
|
this.datasetTemplate = datasetTemplate;
|
|
}
|
|
|
|
public List<UserInfoListingModel> getUsers() {
|
|
return users;
|
|
}
|
|
|
|
public void setUsers(List<UserInfoListingModel> users) {
|
|
this.users = users;
|
|
}
|
|
|
|
public String getDmp() {
|
|
return dmp;
|
|
}
|
|
|
|
public void setDmp(String dmp) {
|
|
this.dmp = dmp;
|
|
}
|
|
|
|
public String getGrant() {
|
|
return grant;
|
|
}
|
|
|
|
public void setGrant(String grant) {
|
|
this.grant = grant;
|
|
}
|
|
|
|
public String getDescription() {
|
|
return description;
|
|
}
|
|
|
|
public void setDescription(String description) {
|
|
this.description = description;
|
|
}
|
|
|
|
public Boolean getPublic() {
|
|
return isPublic;
|
|
}
|
|
|
|
public void setPublic(Boolean aPublic) {
|
|
isPublic = aPublic;
|
|
}
|
|
|
|
public Date getModified() {
|
|
return modified;
|
|
}
|
|
|
|
public void setModified(Date modified) {
|
|
this.modified = modified;
|
|
}
|
|
|
|
@Override
|
|
public DatasetOverviewModel fromDataModel(Dataset entity) {
|
|
this.id = entity.getId();
|
|
this.label = entity.getLabel();
|
|
this.status = entity.getStatus();
|
|
this.datasetTemplate = new DatasetProfileOverviewModel().fromDataModel(entity.getProfile());
|
|
this.users = entity.getDmp().getUsers().stream().map(x -> new UserInfoListingModel().fromDataModel(x)).collect(Collectors.toList());
|
|
this.dmp = entity.getDmp().getLabel();
|
|
this.grant = entity.getDmp().getGrant().getLabel();
|
|
this.description = entity.getDescription();
|
|
this.isPublic = entity.getDmp().isPublic();
|
|
this.modified = entity.getModified();
|
|
|
|
return this;
|
|
}
|
|
|
|
@Override
|
|
public Dataset toDataModel() throws Exception {
|
|
return null;
|
|
}
|
|
|
|
@Override
|
|
public String getHint() {
|
|
return null;
|
|
}
|
|
}
|