forked from D-Net/dnet-hadoop
better implementation for the fix
This commit is contained in:
parent
b42abc9904
commit
287753417d
|
@ -16,7 +16,7 @@ public class Community implements Serializable {
|
||||||
private List<String> subjects = new ArrayList<>();
|
private List<String> subjects = new ArrayList<>();
|
||||||
private List<Provider> providers = new ArrayList<>();
|
private List<Provider> providers = new ArrayList<>();
|
||||||
private List<ZenodoCommunity> zenodoCommunities = new ArrayList<>();
|
private List<ZenodoCommunity> zenodoCommunities = new ArrayList<>();
|
||||||
private SelectionConstraints constraints = new SelectionConstraints();
|
private SelectionConstraints constraints;
|
||||||
|
|
||||||
public String toJson() {
|
public String toJson() {
|
||||||
final Gson g = new Gson();
|
final Gson g = new Gson();
|
||||||
|
@ -27,7 +27,7 @@ public class Community implements Serializable {
|
||||||
return !getSubjects().isEmpty()
|
return !getSubjects().isEmpty()
|
||||||
|| !getProviders().isEmpty()
|
|| !getProviders().isEmpty()
|
||||||
|| !getZenodoCommunities().isEmpty()
|
|| !getZenodoCommunities().isEmpty()
|
||||||
|| constraints != null;
|
|| !getConstraints().getCriteria().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
|
|
|
@ -92,7 +92,7 @@ public class CommunityConfigurationFactory {
|
||||||
private static SelectionConstraints parseConstrains(Node node) {
|
private static SelectionConstraints parseConstrains(Node node) {
|
||||||
Node advConstsNode = node.selectSingleNode("./advancedConstraints");
|
Node advConstsNode = node.selectSingleNode("./advancedConstraints");
|
||||||
if (advConstsNode == null || StringUtils.isBlank(StringUtils.trim(advConstsNode.getText()))) {
|
if (advConstsNode == null || StringUtils.isBlank(StringUtils.trim(advConstsNode.getText()))) {
|
||||||
return null;
|
return new SelectionConstraints();
|
||||||
}
|
}
|
||||||
SelectionConstraints selectionConstraints = new Gson()
|
SelectionConstraints selectionConstraints = new Gson()
|
||||||
.fromJson(advConstsNode.getText(), SelectionConstraints.class);
|
.fromJson(advConstsNode.getText(), SelectionConstraints.class);
|
||||||
|
|
Loading…
Reference in New Issue