Lombok - how to create custom setters and apply on different member in java

前端 未结 2 822
暖寄归人
暖寄归人 2021-01-28 12:53

I would like to understand how to create a custom setter in Lombok and apply the setter on specific member. I have a class with 100 members, and for 50 of them I have a custom s

2条回答
  •  鱼传尺愫
    2021-01-28 13:31

    Based on the current version's documentation (https://projectlombok.org/features/GetterSetter), it doesn't seem to include a way to specify custom checks for the setter (or getter). I fear you will have to manually code each and every setter.

    The same applies for the experimental @Accessor feature.

提交回复
热议问题