Quick Example
record Person(String name, int age) implements Withable<Person> {}
// Wither in action:
Person jonas = new Person("Jonas", 30);
Person older = jonas.with(Person::age, 42);
Why Record Wither?
- Immutable by Design – generate
with
-methods without breaking immutability - Lightweight Utility – just a small library, no heavy dependencies
- Integration Friendly – works seamlessly with Maven, Gradle, etc.
- No more boilerplate wither methods
- Works out-of-the-box with Java Records