Sergey Gotliv has uploaded a new change for review. Change subject: engine: Remove concreteStorageType property from StorageType enum. ......................................................................
engine: Remove concreteStorageType property from StorageType enum. StorageType enum represents all supported types of storage, unfortunately it also contains UNKNOWN(0) and ALL(-1) values which are not a real storage types. In order to establish which type is real this enum doesn't need additional state 'concreteStorageType', it can just check the value. Change-Id: Ibdd785ccb3c0e074f5a14bec1ee60c6d374700a1 Signed-off-by: Sergey Gotliv <sgot...@redhat.com> --- M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageType.java 1 file changed, 12 insertions(+), 17 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/12/21312/1 diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageType.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageType.java index a35e18e..2067c6d 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageType.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageType.java @@ -3,22 +3,19 @@ import java.util.HashMap; public enum StorageType implements Identifiable { - UNKNOWN(0, false), - NFS(1, true), - FCP(2, true), - ISCSI(3, true), - LOCALFS(4, true), - POSIXFS(6, true), - GLUSTERFS(7, true), - GLANCE(8, true), - // CIFS(5) - ALL(-1, false); + ALL(-1), + UNKNOWN(0), + NFS(1), + FCP(2), + ISCSI(3), + LOCALFS(4), + POSIXFS(6), + GLUSTERFS(7), + GLANCE(8); private int value; - // this member is indicating whether then enum value represents an actual storage type - private boolean isConcreteStorageType; - private static final java.util.HashMap<Integer, StorageType> mappings = new HashMap<Integer, StorageType>(); + private static final HashMap<Integer, StorageType> mappings = new HashMap<Integer, StorageType>(); static { for (StorageType storageType : values()) { @@ -26,9 +23,8 @@ } } - private StorageType(int value, boolean isConcreteStorageType) { + private StorageType(int value) { this.value = value; - this.isConcreteStorageType = isConcreteStorageType; } @Override @@ -37,7 +33,7 @@ } public boolean isConcreteStorageType() { - return this.isConcreteStorageType; + return this.getValue() > 0; } public static StorageType forValue(int value) { @@ -51,5 +47,4 @@ public boolean isBlockDomain() { return this == FCP || this == ISCSI; } - } -- To view, visit http://gerrit.ovirt.org/21312 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibdd785ccb3c0e074f5a14bec1ee60c6d374700a1 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Sergey Gotliv <sgot...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches