transformed JenaRosenkeller importer to use Result-driven pipeline

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2024-12-19 16:25:48 +01:00
parent a17b322001
commit ed8cef3738
8 changed files with 272 additions and 69 deletions
+1
View File
@@ -3,4 +3,5 @@ description = "OpenCloudCal : Application"
dependencies {
implementation(project(":de.srsoftware.cal.api"))
implementation(project(":de.srsoftware.cal.importer"))
implementation("de.srsoftware:tools.util:1.1.1")
}
@@ -1,12 +1,23 @@
/* © SRSoftware 2024 */
package de.srsoftware.cal.app;
import de.srsoftware.cal.api.Appointment;
import de.srsoftware.cal.importer.JenaRosenkeller;
import de.srsoftware.tools.Payload;
import java.io.IOException;
public class Application {
public static void main(String[] args) throws IOException {
var rosenkeller = new JenaRosenkeller();
rosenkeller.fetch();
var rosenkeller = new JenaRosenkeller();
var appointments = rosenkeller.fetch();
appointments.forEach(res -> {
System.out.printf("class: %s%n", res.getClass());
if (res instanceof Payload<Appointment> payload) {
System.out.printf("payload: %s%n", payload.get().getClass());
System.out.println(payload.get());
} else {
System.err.println(res);
}
});
}
}