package org.ovirt.engine.core.common.businessentities;

public enum ImageStatus implements Identifiable {
    // FIXME add ids and remove the ordinal impl of getValue
    Unassigned,
    OK,
    LOCKED,
    INVALID,
    ILLEGAL;

    @Override
    public int getValue() {
        return this.ordinal();
    }

    public static ImageStatus forValue(int value) {
        return values()[value];
    }

}

@@ -49,16 +49,65 @@
 ities;%0A%0A
+import java.util.HashMap;%0Aimport java.util.Map;%0A%0A
 public e
@@ -156,126 +156,414 @@
     
-// FIXME add ids and remove the ordinal impl of getValue%0A    Unassigned,%0A
+Unassigned(0),%0A    OK(1),%0A    LOCKED(2),%0A    INVALID(3),%0A    ILLEGAL(4);%0A%0A    private int intValue;%0A    private static Map%3CInteger, ImageStatus%3E mappings = new HashMap%3CInteger, ImageStatus%3E();%0A%0A    static %7B%0A        for (ImageStatus imageStatus : values()) %7B%0A            mappings.put(imageStatus.getValue(), imageStatus);%0A   
     
-OK,
+ %7D
 %0A    
-LOCKED,%0A    INVALID,%0A    ILLEGAL;
+%7D%0A%0A    private ImageStatus(int value) %7B%0A        intValue = value;%0A    %7D
 %0A%0A  
@@ -621,22 +621,16 @@
 urn 
-this.ordinal()
+intValue
 ;%0A  
@@ -705,30 +705,34 @@
 urn 
-values()%5B
+mappings.get(
 value
-%5D
+)
 ;%0A    %7D%0A
 %0A%7D%0A
@@ -728,11 +728,10 @@
 ;%0A    %7D%0A
-%0A
 %7D%0A

Add IDs to ImageStatus