Closed internetstaff closed 2 months ago
Sorry, I'd rather not add lombok to this project. Feel free to provide a PR with builders though.
I can understand your lombok hesitancy, having gone through that myself many years ago.
I'm concerned, however, that otherwise builders will add a large amount of clutter to the model classes.
Do you have an idea of what you'd want that to look like?
I'm concerned, however, that otherwise builders will add a large amount of clutter to the model classes.
I agree. I've had my eyes for some months on https://github.com/jonas-grgt/bob that look like a promising alternative to lombok. It's still a bit young but promising. I'll try experimenting a bit with it see if we could maybe introduce it in this project.
Mhh, this dependency wouldn't fit the bill right now, it doesn't handle inheritance well (not surprised, it's also often an issue with Lombok anyway...).
Rewinding a bit here, what's the motivation for using builders? Is it to have a less verbose/more compact code when you instanciate entities? In which case, would fluent setter be enough, ie instead of writing something like:
private Ticket createSampleTicket() {
Ticket ticket = new Ticket();
ticket.setId(Math.abs(RANDOM.nextLong()));
ticket.setComment(new Comment(TICKET_COMMENT1));
ticket.setUpdatedAt(NOW);
ticket.setCustomStatusId(Math.abs(RANDOM.nextLong()));
return ticket;
}
you'd write:
private Ticket createSampleTicket() {
return new Ticket()
.setId(Math.abs(RANDOM.nextLong()))
.setComment(new Comment(TICKET_COMMENT1))
.setUpdatedAt(NOW)
.setCustomStatusId(Math.abs(RANDOM.nextLong()));
}
Fluent setters would be an improvement, but tbh I seem to rarely see that as a pattern anymore relative to builders. :shrug:
This issue/PR is stale because it has been opened 60 days with no activity. Remove stale label or comment or this will be closed in 7 days
Any chance of adding e.g. lombok
@Builder
s for entities?