Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Show HN: I Wrote a Book on Java. Parent comment
For now, I use Lombok's @Builder annotation. It makes it much easier to create and copy a record, where non-assigned attributes are set to default.
Example:
var bmw = Car.builder().make("BMW").build()
var other = bmw.toBuilder().year(2024).build()
There are no comments on this comment yet.
For now, I use Lombok's @Builder annotation. It makes it much easier to create and copy a record, where non-assigned attributes are set to default.
Example:
It also has a practical toBuilder() syntax that creates a copy of the original record, with some attributes changed