其他分享
首页 > 其他分享> > lombok的@Accessors注解

lombok的@Accessors注解

作者:互联网

@AllArgsConstructor
@Data
@NoArgsConstructor
@Accessors(chain = true)
@EqualsAndHashCode
public class User {
    String name;
    String sex;
    String num;
}

 

使用:

package com.example.springbootstarterhello.chain;

public class TestChain {
    public static void main(String[] args) {
        User user = new User();
       /* user.setSex("ede");
        user.setNum("32323");*/
        user.setName("ego").setNum("123").setSex("male");
        System.out.println(user);
    }
}

 

标签:String,chain,user,User,注解,lombok,public,Accessors
来源: https://www.cnblogs.com/leeego-123/p/11599446.html