Skip to content

Instantly share code, notes, and snippets.

@maxandersen
Created October 24, 2024 22:48
Show Gist options
  • Save maxandersen/ffc3785ebe7326c7d16a166ed6af6ea9 to your computer and use it in GitHub Desktop.
Save maxandersen/ffc3785ebe7326c7d16a166ed6af6ea9 to your computer and use it in GitHub Desktop.
///usr/bin/env jbang "$0" "$@" ; exit $?
//PREVIEW
//JAVA 23+
//JAVAC_OPTIONS -proc:full -s gensrc
//DEPS cc.jilt:jilt:1.6.1
import static java.lang.System.*;
import java.sql.Date;
import org.jilt.Builder;
@Builder
record Person(String name, int age, Date birthday) {
}
@Builder
record Funky(String name, int age, String funky) {
}
class x {
public static void main(String... args) {
var p = PersonBuilder.person().age(42).name("dsaf").birthday(null).build();
out.println(p);
var f = FunkyBuilder.funky().age(42).funky("funky").build();
out.println(f);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment