Person entity #37

Merged
claudio.atzori merged 9 commits from person_entity into master 2024-07-17 11:50:38 +02:00
4 changed files with 184 additions and 3 deletions
Showing only changes of commit a620d3ff21 - Show all commits

View File

@ -1,2 +1,113 @@
package eu.dnetlib.dhp.schema.solr;public class Person { package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.util.List;
public class Person implements Serializable {
private static final long serialVersionUID = 3923041787040187202L;
private String givenName;
private String familyName;
private List<String> alternativeNames;
private String biography;
private List<PersonTopic> subject;
/**
* The Measures.
*/
private List<Measure> indicator;
/**
* The Context.
*/
private List<Context> context;
private Boolean consent;
public static Person newInstance(String givenName, String familyName, List<String> alternativeNames, String biography, List<PersonTopic> subject, List<Measure> indicator, List<Context> context, Boolean consent) {
final Person p = new Person();
p.setGivenName(givenName);
p.setFamilyName(familyName);
p.setAlternativeNames(alternativeNames);
p.setBiography(biography);
p.setSubject(subject);
p.setIndicator(indicator);
p.setContext(context);
p.setConsent(consent);
return p;
}
public Person() {
}
public String getGivenName() {
return givenName;
}
public void setGivenName(String givenName) {
this.givenName = givenName;
}
public String getFamilyName() {
return familyName;
}
public void setFamilyName(String familyName) {
this.familyName = familyName;
}
public List<String> getAlternativeNames() {
return alternativeNames;
}
public void setAlternativeNames(List<String> alternativeNames) {
this.alternativeNames = alternativeNames;
}
public String getBiography() {
return biography;
}
public void setBiography(String biography) {
this.biography = biography;
}
public List<PersonTopic> getSubject() {
return subject;
}
public void setSubject(List<PersonTopic> subject) {
this.subject = subject;
}
public List<Measure> getIndicator() {
return indicator;
}
public void setIndicator(List<Measure> indicator) {
this.indicator = indicator;
}
public List<Context> getContext() {
return context;
}
public void setContext(List<Context> context) {
this.context = context;
}
public Boolean getConsent() {
return consent;
}
public void setConsent(Boolean consent) {
this.consent = consent;
}
} }

View File

@ -1,2 +1,61 @@
package eu.dnetlib.dhp.schema.solr;public class PersonTopic { package eu.dnetlib.dhp.schema.solr;
import java.io.Serializable;
import java.time.Year;
public class PersonTopic implements Serializable {
private static final long serialVersionUID = 6866697695308782412L;
private String value;
private String schema;
private Year fromYear;
private Year toYear;
public static PersonTopic newInstance(String value, String schema, Year fromYear, Year toYear) {
final PersonTopic personTopic = new PersonTopic();
personTopic.setValue(value);
personTopic.setSchema(schema);
personTopic.setFromYear(fromYear);
personTopic.setToYear(toYear);
return personTopic;
}
public PersonTopic() {
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getSchema() {
return schema;
}
public void setSchema(String schema) {
this.schema = schema;
}
public Year getFromYear() {
return fromYear;
}
public void setFromYear(Year fromYear) {
this.fromYear = fromYear;
}
public Year getToYear() {
return toYear;
}
public void setToYear(Year toYear) {
this.toYear = toYear;
}
} }

View File

@ -9,6 +9,7 @@ public enum RecordType implements Serializable {
software, software,
datasource, datasource,
organization, organization,
project; project,
person;
} }

View File

@ -30,6 +30,8 @@ public class SolrRecord implements Serializable {
private Organization organization; private Organization organization;
private Person person;
private List<RelatedRecord> links; private List<RelatedRecord> links;
public SolrRecordHeader getHeader() { public SolrRecordHeader getHeader() {
@ -112,6 +114,14 @@ public class SolrRecord implements Serializable {
this.organization = organization; this.organization = organization;
} }
public Person getPerson() {
return person;
}
public void setPerson(Person person) {
this.person = person;
}
public List<RelatedRecord> getLinks() { public List<RelatedRecord> getLinks() {
return links; return links;
} }