Lazy field initialization with lambdas

后端 未结 14 2320
日久生厌
日久生厌 2020-11-29 23:39

I would like to implement lazy field initialization (or deferred initialization) without an if statement and taking advantage of lambdas. So, I would like to have the same b

14条回答
  •  广开言路
    2020-11-30 00:11

    Project Lombok provides a @Getter(lazy = true) annotation which does exactly what you need.

提交回复
热议问题