package com.bitdubai.fermat_api.layer.dmp_middleware.wallet_store.enums;

import com.bitdubai.fermat_api.layer.all_definition.exceptions.InvalidParameterException;

/**
 * Created by eze on 2015.07.13..
 */
public enum InstallationStatus {
    INSTALLED ("INSED"),
    NOT_INSTALLED ("NOINS"),
    INSTALLING ("INSING"),
    UNINSTALLING("UNING"),
    UNINSTALLED("UNED"),
    INSTALL_AVAILABLE("INSA"),
    UPGRADE_AVAILABLE("UPGA"),
    UPGRADING("UPGING");

    private String code;

    InstallationStatus(final String code){
        this.code = code;
    }

    public String getCode() {
        return this.code;
    }

    public static InstallationStatus getByCode(String code) throws InvalidParameterException{
        switch (code){
            case "INSED": return InstallationStatus.INSTALLED;
            case "NOINS": return InstallationStatus.NOT_INSTALLED;
            case "INSING": return InstallationStatus.INSTALLING;
            case "UNING": return InstallationStatus.UNINSTALLING;
            case "UNED": return InstallationStatus.UNINSTALLED;
            case "INSA": return InstallationStatus.INSTALL_AVAILABLE;
            case "UPGA": return InstallationStatus.UPGRADE_AVAILABLE;
            case "UPGING": return InstallationStatus.UPGRADING;
            //Modified by Manuel Perez 05/08/2015
            default:
                throw new InvalidParameterException(InvalidParameterException.DEFAULT_MESSAGE, null, "Code Received: " + code, "This Code Is Not Valid for the InstalationStatus enum");

        }
    }
}

@@ -362,24 +362,54 @@
 ED(%22UNED%22),%0A
+    NOT_UNINSTALLED(%22NUNED%22),%0A
     INSTALL_
@@ -1083,32 +1083,101 @@
 us.UNINSTALLED;%0A
+            case %22NUNED%22: return InstallationStatus.NOT_UNINSTALLED;%0A
             case

Update fix #1294