How to specify the order of parameters in @AllArgsConstructor in lombok

前端 未结 1 857
孤街浪徒
孤街浪徒 2021-02-19 03:07

If I have a class like below,

import lombok.AllArgsConstructor;

@AllArgsConstructor
class MyClass{
    private String one;
    private Integer three;  
    priv         


        
1条回答
  •  醉话见心
    2021-02-19 03:26

    The lombok document on Constructor, it says: (the last sentence of the third paragraph. Or you can find 'sort' with your browser's find feature)

    The order of the parameters match the order in which the fields appear in your class.

    Though the sentence is in the paragraph for @RequiredArgsConstructor, the same rule looks to apply to @AllArgsConstructor, too.

    https://projectlombok.org/features/constructor

    0 讨论(0)
提交回复
热议问题