From b0aa7cd7fbfa6899b35122b8d4ddeaf9a59f6eed Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Fri, 25 Oct 2019 09:53:08 +0200 Subject: [PATCH] fluent setters --- .../eu/dnetlib/dhp/schema/oaf/Author.java | 15 +++-- .../eu/dnetlib/dhp/schema/oaf/Context.java | 6 +- .../eu/dnetlib/dhp/schema/oaf/Dataset.java | 21 ++++-- .../dhp/schema/oaf/ExternalReference.java | 24 ++++--- .../dnetlib/dhp/schema/oaf/GeoLocation.java | 9 ++- .../eu/dnetlib/dhp/schema/oaf/Instance.java | 24 ++++--- .../dnetlib/dhp/schema/oaf/Organization.java | 49 +++++++++----- .../dhp/schema/oaf/OriginDescription.java | 10 --- .../dhp/schema/oaf/OtherResearchProducts.java | 10 ++- .../dnetlib/dhp/schema/oaf/Publication.java | 3 +- .../eu/dnetlib/dhp/schema/oaf/Qualifier.java | 10 --- .../eu/dnetlib/dhp/schema/oaf/Result.java | 64 ++++++++++++------- .../eu/dnetlib/dhp/schema/oaf/Software.java | 12 ++-- 13 files changed, 157 insertions(+), 100 deletions(-) diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Author.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Author.java index ab66d6824..436bc1b6e 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Author.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Author.java @@ -19,39 +19,44 @@ public class Author implements Serializable { return name; } - public void setName(String name) { + public Author setName(String name) { this.name = name; + return this; } public String getTypology() { return typology; } - public void setTypology(String typology) { + public Author setTypology(String typology) { this.typology = typology; + return this; } public String getProvenance() { return provenance; } - public void setProvenance(String provenance) { + public Author setProvenance(String provenance) { this.provenance = provenance; + return this; } public String getTrust() { return trust; } - public void setTrust(String trust) { + public Author setTrust(String trust) { this.trust = trust; + return this; } public String getValue() { return value; } - public void setValue(String value) { + public Author setValue(String value) { this.value = value; + return this; } } diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Context.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Context.java index 64e23088e..2c3c22d04 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Context.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Context.java @@ -12,15 +12,17 @@ public class Context implements Serializable { return id; } - public void setId(String id) { + public Context setId(String id) { this.id = id; + return this; } public List getDataInfo() { return dataInfo; } - public void setDataInfo(List dataInfo) { + public Context setDataInfo(List dataInfo) { this.dataInfo = dataInfo; + return this; } } diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Dataset.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Dataset.java index 44d5226e9..25fd7e5d5 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Dataset.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Dataset.java @@ -23,55 +23,62 @@ public class Dataset extends Result implements Serializable { return storagedate; } - public void setStoragedate(Field storagedate) { + public Dataset setStoragedate(Field storagedate) { this.storagedate = storagedate; + return this; } public Field getDevice() { return device; } - public void setDevice(Field device) { + public Dataset setDevice(Field device) { this.device = device; + return this; } public Field getSize() { return size; } - public void setSize(Field size) { + public Dataset setSize(Field size) { this.size = size; + return this; } public Field getVersion() { return version; } - public void setVersion(Field version) { + public Dataset setVersion(Field version) { this.version = version; + return this; } public Field getLastmetadataupdate() { return lastmetadataupdate; } - public void setLastmetadataupdate(Field lastmetadataupdate) { + public Dataset setLastmetadataupdate(Field lastmetadataupdate) { this.lastmetadataupdate = lastmetadataupdate; + return this; } public Field getMetadataversionnumber() { return metadataversionnumber; } - public void setMetadataversionnumber(Field metadataversionnumber) { + public Dataset setMetadataversionnumber(Field metadataversionnumber) { this.metadataversionnumber = metadataversionnumber; + return this; } public List getGeolocation() { return geolocation; } - public void setGeolocation(List geolocation) { + public Dataset setGeolocation(List geolocation) { this.geolocation = geolocation; + return this; } } diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/ExternalReference.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/ExternalReference.java index 006658133..523d7c87e 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/ExternalReference.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/ExternalReference.java @@ -31,63 +31,71 @@ public class ExternalReference implements Serializable { return sitename; } - public void setSitename(String sitename) { + public ExternalReference setSitename(String sitename) { this.sitename = sitename; + return this; } public String getLabel() { return label; } - public void setLabel(String label) { + public ExternalReference setLabel(String label) { this.label = label; + return this; } public String getUrl() { return url; } - public void setUrl(String url) { + public ExternalReference setUrl(String url) { this.url = url; + return this; } public String getDescription() { return description; } - public void setDescription(String description) { + public ExternalReference setDescription(String description) { this.description = description; + return this; } public Qualifier getQualifier() { return qualifier; } - public void setQualifier(Qualifier qualifier) { + public ExternalReference setQualifier(Qualifier qualifier) { this.qualifier = qualifier; + return this; } public String getRefidentifier() { return refidentifier; } - public void setRefidentifier(String refidentifier) { + public ExternalReference setRefidentifier(String refidentifier) { this.refidentifier = refidentifier; + return this; } public String getQuery() { return query; } - public void setQuery(String query) { + public ExternalReference setQuery(String query) { this.query = query; + return this; } public DataInfo getDataInfo() { return dataInfo; } - public void setDataInfo(DataInfo dataInfo) { + public ExternalReference setDataInfo(DataInfo dataInfo) { this.dataInfo = dataInfo; + return this; } } diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/GeoLocation.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/GeoLocation.java index 567254a23..104a591f1 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/GeoLocation.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/GeoLocation.java @@ -14,23 +14,26 @@ public class GeoLocation implements Serializable { return point; } - public void setPoint(String point) { + public GeoLocation setPoint(String point) { this.point = point; + return this; } public String getBox() { return box; } - public void setBox(String box) { + public GeoLocation setBox(String box) { this.box = box; + return this; } public String getPlace() { return place; } - public void setPlace(String place) { + public GeoLocation setPlace(String place) { this.place = place; + return this; } } diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Instance.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Instance.java index f27704c5c..4fef24e46 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Instance.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Instance.java @@ -25,63 +25,71 @@ public class Instance implements Serializable { return license; } - public void setLicense(Field license) { + public Instance setLicense(Field license) { this.license = license; + return this; } public Qualifier getAccessright() { return accessright; } - public void setAccessright(Qualifier accessright) { + public Instance setAccessright(Qualifier accessright) { this.accessright = accessright; + return this; } public Qualifier getInstancetype() { return instancetype; } - public void setInstancetype(Qualifier instancetype) { + public Instance setInstancetype(Qualifier instancetype) { this.instancetype = instancetype; + return this; } public KeyValue getHostedby() { return hostedby; } - public void setHostedby(KeyValue hostedby) { + public Instance setHostedby(KeyValue hostedby) { this.hostedby = hostedby; + return this; } public String getUrl() { return url; } - public void setUrl(String url) { + public Instance setUrl(String url) { this.url = url; + return this; } public String getDistributionlocation() { return distributionlocation; } - public void setDistributionlocation(String distributionlocation) { + public Instance setDistributionlocation(String distributionlocation) { this.distributionlocation = distributionlocation; + return this; } public KeyValue getCollectedfrom() { return collectedfrom; } - public void setCollectedfrom(KeyValue collectedfrom) { + public Instance setCollectedfrom(KeyValue collectedfrom) { this.collectedfrom = collectedfrom; + return this; } public Field getDateofacceptance() { return dateofacceptance; } - public void setDateofacceptance(Field dateofacceptance) { + public Instance setDateofacceptance(Field dateofacceptance) { this.dateofacceptance = dateofacceptance; + return this; } } diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Organization.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Organization.java index dd966deb5..260fc22b6 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Organization.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Organization.java @@ -37,132 +37,147 @@ public class Organization extends OafEntity implements Serializable { private Qualifier country; - public Field getLegalshortname() { return legalshortname; } - public void setLegalshortname(Field legalshortname) { + public Organization setLegalshortname(Field legalshortname) { this.legalshortname = legalshortname; + return this; } public Field getLegalname() { return legalname; } - public void setLegalname(Field legalname) { + public Organization setLegalname(Field legalname) { this.legalname = legalname; + return this; } public List> getAlternativeNames() { return alternativeNames; } - public void setAlternativeNames(List> alternativeNames) { + public Organization setAlternativeNames(List> alternativeNames) { this.alternativeNames = alternativeNames; + return this; } public Field getWebsiteurl() { return websiteurl; } - public void setWebsiteurl(Field websiteurl) { + public Organization setWebsiteurl(Field websiteurl) { this.websiteurl = websiteurl; + return this; } public Field getLogourl() { return logourl; } - public void setLogourl(Field logourl) { + public Organization setLogourl(Field logourl) { this.logourl = logourl; + return this; } public Field getEclegalbody() { return eclegalbody; } - public void setEclegalbody(Field eclegalbody) { + public Organization setEclegalbody(Field eclegalbody) { this.eclegalbody = eclegalbody; + return this; } public Field getEclegalperson() { return eclegalperson; } - public void setEclegalperson(Field eclegalperson) { + public Organization setEclegalperson(Field eclegalperson) { this.eclegalperson = eclegalperson; + return this; } public Field getEcnonprofit() { return ecnonprofit; } - public void setEcnonprofit(Field ecnonprofit) { + public Organization setEcnonprofit(Field ecnonprofit) { this.ecnonprofit = ecnonprofit; + return this; } public Field getEcresearchorganization() { return ecresearchorganization; } - public void setEcresearchorganization(Field ecresearchorganization) { + public Organization setEcresearchorganization(Field ecresearchorganization) { this.ecresearchorganization = ecresearchorganization; + return this; } public Field getEchighereducation() { return echighereducation; } - public void setEchighereducation(Field echighereducation) { + public Organization setEchighereducation(Field echighereducation) { this.echighereducation = echighereducation; + return this; } public Field getEcinternationalorganizationeurinterests() { return ecinternationalorganizationeurinterests; } - public void setEcinternationalorganizationeurinterests(Field ecinternationalorganizationeurinterests) { + public Organization setEcinternationalorganizationeurinterests(Field ecinternationalorganizationeurinterests) { this.ecinternationalorganizationeurinterests = ecinternationalorganizationeurinterests; + return this; } public Field getEcinternationalorganization() { return ecinternationalorganization; } - public void setEcinternationalorganization(Field ecinternationalorganization) { + public Organization setEcinternationalorganization(Field ecinternationalorganization) { this.ecinternationalorganization = ecinternationalorganization; + return this; } public Field getEcenterprise() { return ecenterprise; } - public void setEcenterprise(Field ecenterprise) { + public Organization setEcenterprise(Field ecenterprise) { this.ecenterprise = ecenterprise; + return this; } public Field getEcsmevalidated() { return ecsmevalidated; } - public void setEcsmevalidated(Field ecsmevalidated) { + public Organization setEcsmevalidated(Field ecsmevalidated) { this.ecsmevalidated = ecsmevalidated; + return this; } public Field getEcnutscode() { return ecnutscode; } - public void setEcnutscode(Field ecnutscode) { + public Organization setEcnutscode(Field ecnutscode) { this.ecnutscode = ecnutscode; + return this; } public Qualifier getCountry() { return country; } - public void setCountry(Qualifier country) { + public Organization setCountry(Qualifier country) { this.country = country; + return this; } } diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/OriginDescription.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/OriginDescription.java index cba401174..1c803a285 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/OriginDescription.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/OriginDescription.java @@ -16,8 +16,6 @@ public class OriginDescription implements Serializable { private String metadataNamespace; - //private OriginDescription originDescription; - public String getHarvestDate() { return harvestDate; } @@ -72,12 +70,4 @@ public class OriginDescription implements Serializable { return this; } -// public OriginDescription getOriginDescription() { -// return originDescription; -// } -// -// public OriginDescription setOriginDescription(OriginDescription originDescription) { -// this.originDescription = originDescription; -// return this; -// } } diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/OtherResearchProducts.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/OtherResearchProducts.java index 12b578904..3ca231587 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/OtherResearchProducts.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/OtherResearchProducts.java @@ -4,6 +4,7 @@ import java.io.Serializable; import java.util.List; public class OtherResearchProducts extends Result implements Serializable { + private List> contactperson; private List> contactgroup; @@ -14,23 +15,26 @@ public class OtherResearchProducts extends Result implements Serializable { return contactperson; } - public void setContactperson(List> contactperson) { + public OtherResearchProducts setContactperson(List> contactperson) { this.contactperson = contactperson; + return this; } public List> getContactgroup() { return contactgroup; } - public void setContactgroup(List> contactgroup) { + public OtherResearchProducts setContactgroup(List> contactgroup) { this.contactgroup = contactgroup; + return this; } public List> getTool() { return tool; } - public void setTool(List> tool) { + public OtherResearchProducts setTool(List> tool) { this.tool = tool; + return this; } } diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Publication.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Publication.java index 9ca9cd3d6..bf4eab93c 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Publication.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Publication.java @@ -11,7 +11,8 @@ public class Publication extends Result implements Serializable { return journal; } - public void setJournal(Journal journal) { + public Publication setJournal(Journal journal) { this.journal = journal; + return this; } } diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Qualifier.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Qualifier.java index 0320798f0..55d0427aa 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Qualifier.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Qualifier.java @@ -9,8 +9,6 @@ public class Qualifier implements Serializable { private String schemeid; private String schemename; -// private DataInfo dataInfo; - public String getClassid() { return classid; } @@ -47,12 +45,4 @@ public class Qualifier implements Serializable { return this; } -// public DataInfo getDataInfo() { -// return dataInfo; -// } -// -// public Qualifier setDataInfo(DataInfo dataInfo) { -// this.dataInfo = dataInfo; -// return this; -// } } diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Result.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Result.java index 1a0f74aac..b0630825a 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Result.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Result.java @@ -49,172 +49,192 @@ public abstract class Result extends OafEntity implements Serializable { private List instance; - public List getAuthor() { return author; } - public void setAuthor(List author) { + public Result setAuthor(List author) { this.author = author; + return this; } public Qualifier getResulttype() { return resulttype; } - public void setResulttype(Qualifier resulttype) { + public Result setResulttype(Qualifier resulttype) { this.resulttype = resulttype; + return this; } public Qualifier getLanguage() { return language; } - public void setLanguage(Qualifier language) { + public Result setLanguage(Qualifier language) { this.language = language; + return this; } public List getCountry() { return country; } - public void setCountry(List country) { + public Result setCountry(List country) { this.country = country; + return this; } public List getSubject() { return subject; } - public void setSubject(List subject) { + public Result setSubject(List subject) { this.subject = subject; + return this; } public List getTitle() { return title; } - public void setTitle(List title) { + public Result setTitle(List title) { this.title = title; + return this; } public List getRelevantdate() { return relevantdate; } - public void setRelevantdate(List relevantdate) { + public Result setRelevantdate(List relevantdate) { this.relevantdate = relevantdate; + return this; } public List> getDescription() { return description; } - public void setDescription(List> description) { + public Result setDescription(List> description) { this.description = description; + return this; } public Field getDateofacceptance() { return dateofacceptance; } - public void setDateofacceptance(Field dateofacceptance) { + public Result setDateofacceptance(Field dateofacceptance) { this.dateofacceptance = dateofacceptance; + return this; } public Field getPublisher() { return publisher; } - public void setPublisher(Field publisher) { + public Result setPublisher(Field publisher) { this.publisher = publisher; + return this; } public Field getEmbargoenddate() { return embargoenddate; } - public void setEmbargoenddate(Field embargoenddate) { + public Result setEmbargoenddate(Field embargoenddate) { this.embargoenddate = embargoenddate; + return this; } public List> getSource() { return source; } - public void setSource(List> source) { + public Result setSource(List> source) { this.source = source; + return this; } public List> getFulltext() { return fulltext; } - public void setFulltext(List> fulltext) { + public Result setFulltext(List> fulltext) { this.fulltext = fulltext; + return this; } public List> getFormat() { return format; } - public void setFormat(List> format) { + public Result setFormat(List> format) { this.format = format; + return this; } public List> getContributor() { return contributor; } - public void setContributor(List> contributor) { + public Result setContributor(List> contributor) { this.contributor = contributor; + return this; } public Qualifier getResourcetype() { return resourcetype; } - public void setResourcetype(Qualifier resourcetype) { + public Result setResourcetype(Qualifier resourcetype) { this.resourcetype = resourcetype; + return this; } public List> getCoverage() { return coverage; } - public void setCoverage(List> coverage) { + public Result setCoverage(List> coverage) { this.coverage = coverage; + return this; } public Field getRefereed() { return refereed; } - public void setRefereed(Field refereed) { + public Result setRefereed(Field refereed) { this.refereed = refereed; + return this; } public List getContext() { return context; } - public void setContext(List context) { + public Result setContext(List context) { this.context = context; + return this; } public List getExternalReference() { return externalReference; } - public void setExternalReference(List externalReference) { + public Result setExternalReference(List externalReference) { this.externalReference = externalReference; + return this; } public List getInstance() { return instance; } - public void setInstance(List instance) { + public Result setInstance(List instance) { this.instance = instance; + return this; } } diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Software.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Software.java index e696cdb52..451efb99a 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Software.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Software.java @@ -17,31 +17,35 @@ public class Software extends Result implements Serializable { return documentationUrl; } - public void setDocumentationUrl(List> documentationUrl) { + public Software setDocumentationUrl(List> documentationUrl) { this.documentationUrl = documentationUrl; + return this; } public List getLicense() { return license; } - public void setLicense(List license) { + public Software setLicense(List license) { this.license = license; + return this; } public Field getCodeRepositoryUrl() { return codeRepositoryUrl; } - public void setCodeRepositoryUrl(Field codeRepositoryUrl) { + public Software setCodeRepositoryUrl(Field codeRepositoryUrl) { this.codeRepositoryUrl = codeRepositoryUrl; + return this; } public Qualifier getProgrammingLanguage() { return programmingLanguage; } - public void setProgrammingLanguage(Qualifier programmingLanguage) { + public Software setProgrammingLanguage(Qualifier programmingLanguage) { this.programmingLanguage = programmingLanguage; + return this; } }