package it.integry.integrywmsnative.core.REST.model;

/**
 * Created by GiuseppeS on 06/03/2018.
 */

public enum EsitoType {

    OK(1),
    KO(-1);

    @Override
    public String toString() {
        return value.toString();
    }

    private Integer value;

    public Integer value() {
        return value;
    }

    public EsitoType fromString(String val) {
        return EsitoType.valueOf(val);
    }

    public static EsitoType fromIntValue(Integer val) {
        if(val==1)
            return EsitoType.OK;
        else if(val==-1)
            return EsitoType.KO;
        return null;
    }

    EsitoType(Integer v) {
        this.value = v;
    }
}