From 94d481c940fb36da896e2e80a62f39d849477f53 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 2 Jul 2026 16:32:26 +0100 Subject: Add inductive data types example --- examples/05-list/output/java/.gitignore | 2 ++ examples/05-list/output/java/pom.xml | 39 ++++++++++++++++++++++ .../src/main/java/org/zwobble/example/Main.java | 19 +++++++++++ 3 files changed, 60 insertions(+) create mode 100644 examples/05-list/output/java/.gitignore create mode 100644 examples/05-list/output/java/pom.xml create mode 100644 examples/05-list/output/java/src/main/java/org/zwobble/example/Main.java (limited to 'examples/05-list/output/java') diff --git a/examples/05-list/output/java/.gitignore b/examples/05-list/output/java/.gitignore new file mode 100644 index 0000000..ff511d4 --- /dev/null +++ b/examples/05-list/output/java/.gitignore @@ -0,0 +1,2 @@ +/src/gen/ +/target/ diff --git a/examples/05-list/output/java/pom.xml b/examples/05-list/output/java/pom.xml new file mode 100644 index 0000000..7493667 --- /dev/null +++ b/examples/05-list/output/java/pom.xml @@ -0,0 +1,39 @@ + + 4.0.0 + + org.zwobble.hobgoblin.examples + example + 1.0-SNAPSHOT + + + UTF-8 + 25 + 25 + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.6.1 + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + + + + diff --git a/examples/05-list/output/java/src/main/java/org/zwobble/example/Main.java b/examples/05-list/output/java/src/main/java/org/zwobble/example/Main.java new file mode 100644 index 0000000..4cfb23f --- /dev/null +++ b/examples/05-list/output/java/src/main/java/org/zwobble/example/Main.java @@ -0,0 +1,19 @@ +package org.zwobble.example; + +import java.util.List; +import org.zwobble.example.types.point.Path; +import org.zwobble.example.types.point.Point; + +public class Main { + public static void main() { + Path path = new Path(List.of( + new Point(10, 25), + new Point(25, 10) + )); + + Path path2 = Path.arbitrary() + .addPoint(new Point(10, 25)) + .addPoint(new Point(25, 10)) + .build(); + } +} -- cgit v1.2.3