2020-04-30 11:05:17 +02:00
|
|
|
|
2020-05-11 17:32:06 +02:00
|
|
|
package eu.dnetlib.dhp.bulktag.community;
|
2020-04-30 11:05:17 +02:00
|
|
|
|
2020-05-11 17:32:06 +02:00
|
|
|
import java.io.Serializable;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
2020-04-30 11:05:17 +02:00
|
|
|
|
2022-09-23 16:02:19 +02:00
|
|
|
import org.apache.avro.generic.GenericData;
|
2020-05-11 17:38:08 +02:00
|
|
|
|
2022-09-27 14:55:10 +02:00
|
|
|
import com.google.gson.Gson;
|
|
|
|
|
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<>();
|
2020-05-11 17:32:06 +02:00
|
|
|
private List<Provider> providers = new ArrayList<>();
|
2020-04-30 11:05:17 +02:00
|
|
|
private List<ZenodoCommunity> zenodoCommunities = new ArrayList<>();
|
2022-09-23 16:02:19 +02:00
|
|
|
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()
|
2020-05-11 17:32:06 +02:00
|
|
|
|| !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
|
|
|
|
2020-05-11 17:32:06 +02:00
|
|
|
public List<Provider> getProviders() {
|
|
|
|
return providers;
|
2020-04-30 11:05:17 +02:00
|
|
|
}
|
2020-03-03 16:38:50 +01:00
|
|
|
|
2020-05-11 17:32:06 +02: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;
|
|
|
|
}
|
2022-09-23 16:02:19 +02:00
|
|
|
|
|
|
|
public SelectionConstraints getConstraints() {
|
|
|
|
return constraints;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setConstraints(SelectionConstraints constraints) {
|
|
|
|
this.constraints = constraints;
|
|
|
|
}
|
2020-03-03 16:38:50 +01:00
|
|
|
}
|