dnet-hadoop/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/community/Community.java

71 lines
1.5 KiB
Java
Raw Normal View History

2020-04-30 11:05:17 +02:00
package eu.dnetlib.dhp.bulktag.community;
2020-04-30 11:05:17 +02:00
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
2020-04-30 11:05:17 +02:00
2020-05-11 17:38:08 +02:00
import com.google.gson.Gson;
import org.apache.avro.generic.GenericData;
2020-05-11 17:38:08 +02:00
2020-04-21 16:03:51 +02:00
/** Created by miriam on 01/08/2018. */
public class Community implements Serializable {
2020-03-03 16:38:50 +01:00
2020-04-30 11:05:17 +02:00
private String id;
private List<String> subjects = new ArrayList<>();
private List<Provider> providers = new ArrayList<>();
2020-04-30 11:05:17 +02:00
private List<ZenodoCommunity> zenodoCommunities = new ArrayList<>();
private SelectionConstraints constraints = new SelectionConstraints();
2020-03-03 16:38:50 +01:00
2020-04-30 11:05:17 +02:00
public String toJson() {
final Gson g = new Gson();
return g.toJson(this);
}
2020-03-03 16:38:50 +01:00
2020-04-30 11:05:17 +02:00
public boolean isValid() {
return !getSubjects().isEmpty()
|| !getProviders().isEmpty()
2020-04-30 11:05:17 +02:00
|| !getZenodoCommunities().isEmpty();
}
2020-03-03 16:38:50 +01:00
2020-04-30 11:05:17 +02:00
public String getId() {
return id;
}
2020-03-03 16:38:50 +01:00
2020-04-30 11:05:17 +02:00
public void setId(String id) {
this.id = id;
}
2020-03-03 16:38:50 +01:00
2020-04-30 11:05:17 +02:00
public List<String> getSubjects() {
return subjects;
}
2020-03-03 16:38:50 +01:00
2020-04-30 11:05:17 +02:00
public void setSubjects(List<String> subjects) {
this.subjects = subjects;
}
2020-03-03 16:38:50 +01:00
public List<Provider> getProviders() {
return providers;
2020-04-30 11:05:17 +02:00
}
2020-03-03 16:38:50 +01:00
public void setProviders(List<Provider> providers) {
this.providers = providers;
2020-04-30 11:05:17 +02:00
}
2020-03-03 16:38:50 +01:00
2020-04-30 11:05:17 +02:00
public List<ZenodoCommunity> getZenodoCommunities() {
return zenodoCommunities;
}
2020-03-03 16:38:50 +01:00
2020-04-30 11:05:17 +02:00
public void setZenodoCommunities(List<ZenodoCommunity> zenodoCommunities) {
this.zenodoCommunities = zenodoCommunities;
}
public SelectionConstraints getConstraints() {
return constraints;
}
public void setConstraints(SelectionConstraints constraints) {
this.constraints = constraints;
}
2020-03-03 16:38:50 +01:00
}