I have a @Value @AllArgsConstructor
class, and I want each instance of it to have an ID(The first object has the ID of 1, the second is 2, etc..).
until now, before I used lombok but a constructor, my solution used to be:
private static int idsCounter = 0;
and then
this.id = ++idsCounter;
inside the constructor.
so how am I supposed to implement this with Lombok which eliminates the constuctor?