1
0
Fork 0

code formatting

This commit is contained in:
Claudio Atzori 2023-08-02 11:52:10 +02:00
parent 7180911ded
commit 0bc74e2000
2 changed files with 14 additions and 14 deletions

View File

@ -226,19 +226,19 @@ public class GraphCleaningFunctions extends CleaningFunctions {
public static <T extends Oaf> boolean filter(T value) { public static <T extends Oaf> boolean filter(T value) {
if (!(value instanceof Relation) && (Boolean.TRUE if (!(value instanceof Relation) && (Boolean.TRUE
.equals( .equals(
Optional Optional
.ofNullable(value) .ofNullable(value)
.map( .map(
o -> Optional o -> Optional
.ofNullable(o.getDataInfo()) .ofNullable(o.getDataInfo())
.map( .map(
d -> Optional d -> Optional
.ofNullable(d.getInvisible()) .ofNullable(d.getInvisible())
.orElse(true)) .orElse(true))
.orElse(false)) .orElse(false))
.orElse(true)))) { .orElse(true)))) {
return true; return true;
} }
if (value instanceof Datasource) { if (value instanceof Datasource) {

View File

@ -371,7 +371,7 @@ public class GraphCleaningFunctionsTest {
@Test @Test
public void testFilterProject() throws IOException { public void testFilterProject() throws IOException {
String json = IOUtils String json = IOUtils
.toString(getClass().getResourceAsStream("/eu/dnetlib/dhp/oa/graph/clean/project.json")); .toString(getClass().getResourceAsStream("/eu/dnetlib/dhp/oa/graph/clean/project.json"));
Project p_in = MAPPER.readValue(json, Project.class); Project p_in = MAPPER.readValue(json, Project.class);
Assertions.assertEquals(false, GraphCleaningFunctions.filter(p_in)); Assertions.assertEquals(false, GraphCleaningFunctions.filter(p_in));