I have an object which is extended from an ArrayList.
Here is the code:
@Data
@EqualsAndHashCode(callSuper = false)
public class MyObject extends ArrayList<ParentObject>{
private static final long serialVersionUID = "";
}
ParentObject has some set of fields.
While logging this object I get empty object in the logs "MyObject()".
However, if I replace @Data
with @Getter
and @Setter
then it works perfectly and the object is getting printed along with its properties.
As per my understanding @Data
in a way a collection for all getter, setter, hashcode etc. methods. Is there a way to disable specific methods to identify which of these methods is causing the problem?
I got the code working with @Getter
/@Setter
but looking for an understanding as to why @Data
caused this problem.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…