This feature would be very handy.
The correct way to declare a singleton is using an enum:
From Effective Java (2nd Edition):
// Enum singleton - the preferred approach
public enum Elvis {
INSTANCE;
public void leaveTheBuilding() { ... }
}
https://github.com/peichhorn/lombok-pg/wiki/%40Singleton
un-recommend: no update with long time ago
Most helpful comment
The correct way to declare a singleton is using an enum:
From Effective Java (2nd Edition):