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

/**
 *
 * @author jakar
 */
public enum TaskStatus {
 
    INITIAL(0),
    NOT_STARTED(1),
    IN_PROGRESS(2),
    CANCELLED(3),
    DONE(4),
    EXPIRED(99);
    
    private final int value;

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