package types;

/**
 * Created by ikalyvas on 5/30/2018.
 */
public enum LoggingType {
    WARNING(0), ERROR(1), INFO(2), DEBUG(3);

    private Integer value;

    private LoggingType(Integer value) {
        this.value = value;
    }

    public Integer getValue() {
        return value;
    }

    public static LoggingType fromInteger(Integer value) {
        switch (value) {
            case 0:
                return WARNING;
            case 1:
                return ERROR;
            case 2:
                return INFO;
            case 3:
                return DEBUG;
            default:
                throw new RuntimeException("Unsupported LoggingType");
        }
    }
}
