推荐公众号
有彩蛋哦!!!(或者公众号内点击网赚获取彩蛋)
问题描述
警告: @Builder will ignore the initializing expression entirely. If you want the initializing expression to serve as default, add @Builder.Default. If it is not supposed to be settable during building, make the field final.
大致意思是@Builder将忽略类中的默认值,如果想要保留默认值那么添加@Builder.Default注解或者声明为final
解决
很多场景下声明final是不合适的,所以添加@Builder.Default是解决办法
未添加之前
添加之后