Alon Bar-Lev has posted comments on this change.

Change subject: engine: Add infrastructure code for removal of parameter classes
......................................................................


Patch Set 2:

(4 comments)

Will be great to have some answers on previous questions... I still do not 
understand why we need the parameter value class... maybe I am missing 
something.

....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/InvalidParameterValueException.java
Line 9: 
Line 10:     /**
Line 11:      * GWT does not support String.format. This class is used by 
frontend code.
Line 12:      */
Line 13:     public static String format(final String format, final String... 
args) {
I am sorry... but if gwt does not support format and we must be loaded into it, 
then let's revert to append... sorry for the troubles.
Line 14:         String[] split = format.split("%s");
Line 15:         final StringBuffer buffer = new StringBuffer();
Line 16:         for (int i = 0; i < split.length - 1; i += 1) {
Line 17:             buffer.append(split[i]);


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/VdcParameter.java
Line 6: public enum VdcParameter implements IVdcParameter {
Line 7:     ClusterId(Guid.class),
Line 8:     DataCenterId(Guid.class),
Line 9:     RoleId(Guid.class),
Line 10:     StorageDomainId(Guid.class);
can we move he above to other enum, so this one will only have the 
implementation?
Line 11: 
Line 12:     private final Class javaType;
Line 13: 
Line 14:     VdcParameter(Class javaType) {


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/VdcParameterValue.java
Line 2: 
Line 3: import java.io.Serializable;
Line 4: import 
org.ovirt.engine.core.common.queries.InvalidParameterValueException;
Line 5: 
Line 6: public class VdcParameterValue<T> implements Serializable {
here I lost you... why do we need this class?
Line 7: 
Line 8:     private IVdcParameter key;
Line 9:     private T value;
Line 10: 


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/VdcParametersMap.java
Line 19:         VdcParameterValue.raiseExceptionIfInvalidObjectType(param, 
value);
Line 20:         paramsMap.put(param.toString(), new VdcParameterValue(param, 
value));
Line 21:     }
Line 22: 
Line 23:     public Object getParameterValue(String param) {
can we have template and return a type real type that is requested?

 String x = getParameter<String>(enum);
 int y = getParameter<Integer>(enum);
Line 24:         return paramsMap.get(param);
Line 25:     }
Line 26:     public Object getParameterValue(IVdcParameter param) {
Line 27:         VdcParameterValue paramValue = paramsMap.get(param.toString());


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I6a0970e492c0eff561888a46b02e47645ff68fc3
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ravi Nori <rn...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Barak Azulay <bazu...@redhat.com>
Gerrit-Reviewer: Ravi Nori <rn...@redhat.com>
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