1.3 released: java.util.Optional support

13 views
Skip to first unread message

Chris Purcell

unread,
Oct 21, 2015, 4:13:57 PM10/21/15
to FreeBuilder, mli...@palantir.com, mzou...@palantir.com
Hi folks!

We've just released @FreeBuilder 1.3, adding support for java.util.Optional. Thanks to Palantir (and more specifically Merrick Zoubeiri and Mateusz Litwin) for sponsoring this one via code reviews.

import java.util.Optional;

@FreeBuilder
interface Person {
 
String getName();
 
Optional<String> getPassportId();

 
class Builder extends Person_Builder {}
}

Person phil = new Person.Builder().setName("Phil").build();
assertFalse(phil.getPassportId().isPresent());
Person joe = new Person.Builder().setName("Joe").setPassportId("22433B").build();
assertTrue(joe.getPassportId().isPresent());

If you have any features you'd like added to @FreeBuilder, and are willing to sponsor them by providing code reviews, please do get in touch!

Happy coding,
Chris

Reply all
Reply to author
Forward
0 new messages