package id.iptek.utms.agent.model.enumeration;

/**
 *
 * @author jakar
 */
public enum TaskActivity {
 
    INITIAL(0),
    PUBLISHED(1),
    ACCEPTED(2),
    DOWNLOAD_STARTED(3),
    DOWNLOAD_SUCCESS(4),
    DOWNLOAD_FAIL(5),
    INSTALL_STARTED(6),
    INSTALL_SUCCESS(7),
    INSTALL_FAIL(8),
    EXPIRED(99);
    
    private final int value;

    private TaskActivity(int value) {
        this.value = value;
    }
    
    public int getValue() {
        return value;
    }
    
    public static TaskActivity fromValue(int value) {
        TaskActivity val = null;
        for(TaskActivity _val : TaskActivity.values()) {
            if(_val.getValue() == value) {
                val = _val;
                break;
            }
        }
        return val;
    }
}
