Martin Peřina has posted comments on this change. Change subject: core: Use ToStringBuilder in sla classes ......................................................................
Patch Set 1: (1 comment) https://gerrit.ovirt.org/#/c/39981/1/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/profiles/ProfileBase.java File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/profiles/ProfileBase.java: Line 139: Line 140: } Line 141: Line 142: @Override Line 143: public String toString() { > so instead of polimorphic build just create a string builder here and the s If I use your suggestion than the output in CpuProfile will be: "ProfileBase:{id='1', description='', ... }CpuProfile:{clusterId='XYZ'}" I we use current approach, then the output will be: "CpuProfile:{id='1', description='', ..., clusterId='XYZ'}" I suppose you agree that the current output is better. So if you don't like the idea of appendAttributes() methods, then the only solution IMO is to create new ToStringBuilder instance in parent and all children and also to add all parent's attributes in all children toString() methods. But IMO appendAttributes() is better way how to handle this Line 144: return appendAttributes(ToStringBuilder.forInstance(this)).build(); Line 145: } -- To view, visit https://gerrit.ovirt.org/39981 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0ed7b26ec4fbade8b1f63aaa7138de4e6ce49937 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Martin Peřina <[email protected]> Gerrit-Reviewer: Gilad Chaplik <[email protected]> Gerrit-Reviewer: Martin Peřina <[email protected]> Gerrit-Reviewer: Moti Asayag <[email protected]> Gerrit-Reviewer: Roy Golan <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
