T11: Organization, Company, link entities + round-trip [checkpoint]
This commit is contained in:
@@ -4,6 +4,7 @@ import com.developx.szpitale.model.CanonicalDataset;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
@@ -50,4 +51,10 @@ public class CanonicalReader {
|
||||
public CanonicalDataset readSingle(Path inputDir, String voivodeship) throws IOException {
|
||||
return readAll(inputDir, voivodeship).stream().findFirst().orElse(null);
|
||||
}
|
||||
|
||||
public static CanonicalDataset readDataset(File file) throws IOException {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.registerModule(new JavaTimeModule());
|
||||
return mapper.readValue(file, CanonicalDataset.class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user