Yair Zaslavsky has posted comments on this change.
Change subject: core: Introducing Business Entity comparators
......................................................................
Patch Set 1: (2 inline comments)
....................................................
File
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/BusinessEntityComparator.java
Line 5:
Line 6: /**
Line 7: * Generic for implementing a business entity comparator based on ID
comparison
Line 8: */
Line 9: public class BusinessEntityComparator<T extends BusinessEntity<ID>, ID
extends Serializable & Comparable<? super ID>> implements Comparator<T> {
Why? we're not serializing it, right? if it was a comparable, I would have 100%
agreed here.
Line 10:
Line 11: @Override
Line 12: public int compare(T o1, T o2) {
Line 13: return o1.getId().compareTo(o2.getId());
Line 13: return o1.getId().compareTo(o2.getId());
Line 14: }
Line 15:
Line 16: public static <T extends BusinessEntity<ID>, ID extends
Serializable & Comparable<? super ID>> BusinessEntityComparator<T, ID>
newInstance() {
Line 17: return new BusinessEntityComparator<T, ID>();
This cannot be performed here, this is generic class.
How will you holds various intstances per different business entities (i.e -
VmDynamic, DiskImageDynamic).
Would you want to hold these at the stateless classes?
Line 18: }
--
To view, visit http://gerrit.ovirt.org/8290
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I979cb7d2273c2eaaa2866dcb4a5f760e9266e11a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches