Liron Ar has posted comments on this change.

Change subject: core: adding BusinessEntityHelper (with buildIdMap)
......................................................................


Patch Set 1:

(3 comments)

http://gerrit.ovirt.org/#/c/26261/1/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/BusinessEntityHelper.java
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/BusinessEntityHelper.java:

Line 1: package org.ovirt.engine.core.common.utils;
> At common as you would like frontend to "enjoy" this as well?
yes, why not?
Line 2: 
Line 3: import java.util.HashMap;
Line 4: import java.util.Map;
Line 5: 


Line 5: 
Line 6: import org.ovirt.engine.core.common.businessentities.BusinessEntity;
Line 7: import org.ovirt.engine.core.compat.Guid;
Line 8: 
Line 9: public class BusinessEntityHelper {
> What about entities like
any entity that we'd like could be changed to inherit from it as well,  that's 
general utility for BusniessEntity and it's sublclasses.
Line 10: 
Line 11:     private BusinessEntityHelper() {}
Line 12: 
Line 13:     public static <T extends BusinessEntity<Guid>> Map<Guid, T> 
buildIdMap(Iterable<T> businessEntities) {


Line 10: 
Line 11:     private BusinessEntityHelper() {}
Line 12: 
Line 13:     public static <T extends BusinessEntity<Guid>> Map<Guid, T> 
buildIdMap(Iterable<T> businessEntities) {
Line 14:         Map<Guid, T> toReturn = new HashMap<Guid, T>();
> Why not JDK 7 syntax? (new HashMap<>)  due to GWT?
because common is built using jdk6 compatibility level
Line 15:         for (T entity : businessEntities) {
Line 16:             toReturn.put(entity.getId(), entity);
Line 17:         }
Line 18: 


-- 
To view, visit http://gerrit.ovirt.org/26261
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id9349aea29e68368ddbe39f63d33f30144ab73cd
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liron Ar <lara...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Liron Ar <lara...@redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com>
Gerrit-Reviewer: Roy Golan <rgo...@redhat.com>
Gerrit-Reviewer: Tal Nisan <tni...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to