topic description
how to specify that fields are not added to toString
when JAVA Lombok uses @ Datarelated codes
/ / Please paste the code text below (do not replace the code with pictures)
import lombok.Data;
import java.io.Serializable;
@Data
public class User implements Serializable {
private Integer id;
private String name;
private String code;
}
for example, the User class now uses @ Data, when using new User (). ToString (), the output string has three id/name/code fields in it, but what should I do if I don"t want the code field in it?