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

80 lines
1.8 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
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<>();
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();
private SelectionConstraints removeConstraints = 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()
|| !getZenodoCommunities().isEmpty()
|| getConstraints().getCriteria() != null;
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 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;
}
public SelectionConstraints getRemoveConstraints() {
return removeConstraints;
}
public void setRemoveConstraints(SelectionConstraints removeConstraints) {
this.removeConstraints = removeConstraints;
}
2020-03-03 16:38:50 +01:00
}