Add isPublic on DtasetListingModel

This commit is contained in:
George Kalampokis 2020-06-30 16:14:18 +03:00
parent f1644d1fa0
commit 1cec40a4da
1 changed files with 10 additions and 0 deletions

View File

@ -32,6 +32,7 @@ public class DatasetListingModel implements DataModel<Dataset, DatasetListingMod
private Date dmpPublishedAt;
private int version;
private List<UserInfoListingModel> users;
private Boolean isPublic;
public String getId() {
return id;
@ -167,6 +168,14 @@ public class DatasetListingModel implements DataModel<Dataset, DatasetListingMod
this.users = users;
}
public Boolean getPublic() {
return isPublic;
}
public void setPublic(Boolean aPublic) {
isPublic = aPublic;
}
@Override
public DatasetListingModel fromDataModel(Dataset entity) {
this.id = entity.getId() != null ? entity.getId().toString() : "";
@ -188,6 +197,7 @@ public class DatasetListingModel implements DataModel<Dataset, DatasetListingMod
this.dmpPublishedAt = entity.getDmp().getPublishedAt();
this.version = entity.getDmp().getVersion();
this.users = entity.getDmp() != null ? entity.getDmp().getUsers().stream().map(x -> new UserInfoListingModel().fromDataModel(x)).collect(Collectors.toList()) : new ArrayList<>();
this.isPublic = entity.getDmp() != null ? entity.getDmp().isPublic() : false;
return this;
}