package eu.dnetlib.openaire.community; import java.util.List; import com.fasterxml.jackson.annotation.JsonAutoDetect; import eu.dnetlib.openaire.community.selectioncriteria.SelectionCriteria; import io.swagger.v3.oas.annotations.media.Schema; import javax.persistence.criteria.Selection; @JsonAutoDetect public class CommunityWritableProperties { @Schema(description = "community name") private String name; @Schema(description = "community short name") private String shortName; @Schema(description = "community description") private String description; @Schema(description = "http url for the community logo") private String logoUrl; @Schema(description = "list of subjects (keywords) that characterise this community") private List subjects; @Schema(description = "list of fos that characterise this community") private List fos; @Schema(description = "list of sdg that characterise this community") private List sdg; @Schema(description = "Advanced constraint for the association of results to the community") private SelectionCriteria advancedConstraint; @Schema(description = "status of the community, drives its visibility") private CommunityStatus status; @Schema(description = "id of the main Zenodo community") private String mainZenodoCommunity; public static CommunityWritableProperties fromDetails(final CommunityDetails details) { final CommunityWritableProperties p = new CommunityWritableProperties(); p.setName(details.getName()); p.setShortName(details.getShortName()); p.setDescription(details.getDescription()); p.setLogoUrl(details.getLogoUrl()); p.setSubjects(details.getSubjects()); p.setStatus(details.getStatus()); p.setMainZenodoCommunity(details.getZenodoCommunity()); p.setFos(details.getFos()); p.setSdg(details.getSdg()); p.setAdvancedConstraint(details.getAdvancedConstraint()); return p; } public List getFos() { return fos; } public void setFos(List fos) { this.fos = fos; } public List getSdg() { return sdg; } public void setSdg(List sdg) { this.sdg = sdg; } public SelectionCriteria getAdvancedConstraint() { return advancedConstraint; } public void setAdvancedConstraint(SelectionCriteria advancedConstraint) { this.advancedConstraint = advancedConstraint; } public String getName() { return name; } public void setName(final String name) { this.name = name; } public String getShortName() { return shortName; } public void setShortName(final String shortName) { this.shortName = shortName; } public String getDescription() { return description; } public void setDescription(final String description) { this.description = description; } public String getLogoUrl() { return logoUrl; } public void setLogoUrl(final String logoUrl) { this.logoUrl = logoUrl; } public List getSubjects() { return subjects; } public void setSubjects(final List subjects) { this.subjects = subjects; } public CommunityStatus getStatus() { return status; } public void setStatus(final CommunityStatus status) { this.status = status; } public String getMainZenodoCommunity() { return mainZenodoCommunity; } public void setMainZenodoCommunity(final String mainZenodoCommunity) { this.mainZenodoCommunity = mainZenodoCommunity; } }