Ravi Nori has posted comments on this change. Change subject: engine: Add infrastructure code for removal of parameter classes ......................................................................
Patch Set 14: (3 comments) .................................................... File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/GenericVdcParameter.java Line 1: package org.ovirt.engine.core.common.utils; Line 2: Line 3: import org.ovirt.engine.core.compat.Guid; Line 4: Line 5: public class GenericVdcParameter { Good idea I like it, there is such functionality in eclipse and netbeans. But how do we enforce this restriction on the parameter classes? Should we move create function to VdcParameterMeta so the creation of parameters will read public final static VdcParameter GUID_ID = create("GUID_ID", Guid.class, "82853410- f449-46a8-99bc-44e1330b8f3c"); I will rename the class and add [s] Line 6: Line 7: public final static VdcParameter GUID_ID = VdcParameter.create("GUID_ID", Guid.class, "82853410-f449-46a8-99bc-44e1330b8f3c"); Line 8: .................................................... File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/InvalidParameterUuidException.java Line 1: package org.ovirt.engine.core.common.utils; Line 2: Line 3: public class InvalidParameterUuidException extends IllegalArgumentException { Line 4: Line 5: public InvalidParameterUuidException(String name, String uuid, String existingName) { Ok will do Line 6: super("Invalid value for uuid " + uuid + " for Parameter " + name + Line 7: ". A parameter with the same uuid already exists " + existingName); Line 8: } Line 9: .................................................... File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/VdcParametersMap.java If we implement Map we need to implement a lot of methods, I think they are unnecessary and getting map properties by composition works best in out case. @Override public boolean isEmpty() { @Override public boolean containsKey(Object key) { @Override public boolean containsValue(Object value) { @Override public Object get(Object key) { @Override public Object put(Object key, Object value) { @Override public Object remove(Object key) { @Override public void putAll(Map m) { @Override public void clear() { @Override public Set keySet() { @Override public Collection values() { Line 1: package org.ovirt.engine.core.common.utils; Line 2: Line 3: import java.io.Serializable; Line 4: import java.util.Collections; -- 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: 14 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: Liran Zelkha <lzel...@redhat.com> Gerrit-Reviewer: Ravi Nori <rn...@redhat.com> Gerrit-Reviewer: Yaniv Bronhaim <ybron...@redhat.com> Gerrit-Reviewer: mooli tayer <mta...@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