in theory, just auto-formatting after mvn compile
This commit is contained in:
parent
bece04b330
commit
112da6d76a
|
@ -1,10 +1,10 @@
|
||||||
|
|
||||||
package eu.dnetlib.dhp.common;
|
package eu.dnetlib.dhp.common;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
public class Constants {
|
public class Constants {
|
||||||
|
|
||||||
public static final Map<String, String> accessRightsCoarMap = Maps.newHashMap();
|
public static final Map<String, String> accessRightsCoarMap = Maps.newHashMap();
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
|
|
||||||
package eu.dnetlib.dhp.common;
|
package eu.dnetlib.dhp.common;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import eu.dnetlib.dhp.schema.common.ModelConstants;
|
import eu.dnetlib.dhp.schema.common.ModelConstants;
|
||||||
import eu.dnetlib.dhp.schema.dump.oaf.*;
|
import eu.dnetlib.dhp.schema.dump.oaf.*;
|
||||||
import eu.dnetlib.dhp.schema.dump.oaf.community.CommunityInstance;
|
import eu.dnetlib.dhp.schema.dump.oaf.community.CommunityInstance;
|
||||||
|
@ -10,10 +14,6 @@ import eu.dnetlib.dhp.schema.oaf.Field;
|
||||||
import eu.dnetlib.dhp.schema.oaf.Journal;
|
import eu.dnetlib.dhp.schema.oaf.Journal;
|
||||||
import eu.dnetlib.dhp.schema.oaf.StructuredProperty;
|
import eu.dnetlib.dhp.schema.oaf.StructuredProperty;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
public class GraphResultMapper implements Serializable {
|
public class GraphResultMapper implements Serializable {
|
||||||
|
|
||||||
public static <E extends eu.dnetlib.dhp.schema.oaf.OafEntity> Result map(
|
public static <E extends eu.dnetlib.dhp.schema.oaf.OafEntity> Result map(
|
||||||
|
@ -291,12 +291,10 @@ public class GraphResultMapper implements Serializable {
|
||||||
.map(cf -> KeyValue.newInstance(cf.getKey(), cf.getValue()))
|
.map(cf -> KeyValue.newInstance(cf.getKey(), cf.getValue()))
|
||||||
.collect(Collectors.toList()));
|
.collect(Collectors.toList()));
|
||||||
|
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static CommunityInstance getInstance(eu.dnetlib.dhp.schema.oaf.Instance i) {
|
private static CommunityInstance getInstance(eu.dnetlib.dhp.schema.oaf.Instance i) {
|
||||||
CommunityInstance instance = new CommunityInstance();
|
CommunityInstance instance = new CommunityInstance();
|
||||||
|
|
||||||
|
@ -347,7 +345,6 @@ public class GraphResultMapper implements Serializable {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static Subject getSubject(StructuredProperty s) {
|
private static Subject getSubject(StructuredProperty s) {
|
||||||
Subject subject = new Subject();
|
Subject subject = new Subject();
|
||||||
subject.setSubject(ControlledField.newInstance(s.getQualifier().getClassid(), s.getValue()));
|
subject.setSubject(ControlledField.newInstance(s.getQualifier().getClassid(), s.getValue()));
|
||||||
|
|
|
@ -65,7 +65,8 @@ public abstract class Oaf implements Serializable {
|
||||||
mergeOAFDataInfo(o);
|
mergeOAFDataInfo(o);
|
||||||
|
|
||||||
setLastupdatetimestamp(
|
setLastupdatetimestamp(
|
||||||
Math.max(
|
Math
|
||||||
|
.max(
|
||||||
Optional.ofNullable(getLastupdatetimestamp()).orElse(0L),
|
Optional.ofNullable(getLastupdatetimestamp()).orElse(0L),
|
||||||
Optional.ofNullable(o.getLastupdatetimestamp()).orElse(0L)));
|
Optional.ofNullable(o.getLastupdatetimestamp()).orElse(0L)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -371,7 +371,8 @@ public class MappersTest {
|
||||||
assertEquals("OPEN", p.getInstance().get(0).getAccessright().getClassid());
|
assertEquals("OPEN", p.getInstance().get(0).getAccessright().getClassid());
|
||||||
assertValidId(p.getInstance().get(0).getCollectedfrom().getKey());
|
assertValidId(p.getInstance().get(0).getCollectedfrom().getKey());
|
||||||
assertValidId(p.getInstance().get(0).getHostedby().getKey());
|
assertValidId(p.getInstance().get(0).getHostedby().getKey());
|
||||||
assertEquals("http://creativecommons.org/licenses/by/3.0/de/legalcode", p.getInstance().get(0).getLicense().getValue());
|
assertEquals(
|
||||||
|
"http://creativecommons.org/licenses/by/3.0/de/legalcode", p.getInstance().get(0).getLicense().getValue());
|
||||||
assertEquals(1, p.getInstance().get(0).getUrl().size());
|
assertEquals(1, p.getInstance().get(0).getUrl().size());
|
||||||
// System.out.println(p.getInstance().get(0).getUrl().get(0));
|
// System.out.println(p.getInstance().get(0).getUrl().get(0));
|
||||||
// System.out.println(p.getInstance().get(0).getHostedby().getValue());
|
// System.out.println(p.getInstance().get(0).getHostedby().getValue());
|
||||||
|
|
Loading…
Reference in New Issue