/*
 * SDK Pullenti Unitext, version 4.33, fabruary 2026. Copyright (c) 2013-2026, Pullenti. All rights reserved. 
 * Non-Commercial Freeware and Commercial Software. 
 * This class is generated using the converter UniSharping (www.unisharping.ru) from Pullenti C# project. 
 * The latest version of the code is available on the site www.pullenti.ru
 */

const Hashtable = require("./../unisharp/Hashtable");

// Уравень качества распознавания
class UnilayOcrQuality {

    constructor(val, str) {
        this.m_val = val;
        this.m_str = str;
    }
    toString() {
        return this.m_str;
    }
    value() {
        return this.m_val;
    }
    static of(val) {
        if(val instanceof UnilayOcrQuality) 
            return val;
        if(typeof val === 'string' || val instanceof String) {
            val = val.toUpperCase();
            if(UnilayOcrQuality.mapStringToEnum.containsKey(val))
                return UnilayOcrQuality.mapStringToEnum.get(val);
            return null;
        }
        if(UnilayOcrQuality.mapIntToEnum.containsKey(val))
            return UnilayOcrQuality.mapIntToEnum.get(val);
        let it = new UnilayOcrQuality(val, val.toString());
        UnilayOcrQuality.mapIntToEnum.put(val, it);
        UnilayOcrQuality.mapStringToEnum.put(val.toString(), it);
        return it;
    }
    static isDefined(val) {
        return UnilayOcrQuality.m_Keys.indexOf(val) >= 0;
    }
    static getValues() {
        return UnilayOcrQuality.m_Values;
    }
    static static_constructor() {
        UnilayOcrQuality.mapIntToEnum = new Hashtable();
        UnilayOcrQuality.mapStringToEnum = new Hashtable();
        UnilayOcrQuality.UNDEFINED = new UnilayOcrQuality(0, "UNDEFINED");
        UnilayOcrQuality.mapIntToEnum.put(UnilayOcrQuality.UNDEFINED.value(), UnilayOcrQuality.UNDEFINED); 
        UnilayOcrQuality.mapStringToEnum.put(UnilayOcrQuality.UNDEFINED.m_str.toUpperCase(), UnilayOcrQuality.UNDEFINED); 
        UnilayOcrQuality.VERYBAD = new UnilayOcrQuality(1, "VERYBAD");
        UnilayOcrQuality.mapIntToEnum.put(UnilayOcrQuality.VERYBAD.value(), UnilayOcrQuality.VERYBAD); 
        UnilayOcrQuality.mapStringToEnum.put(UnilayOcrQuality.VERYBAD.m_str.toUpperCase(), UnilayOcrQuality.VERYBAD); 
        UnilayOcrQuality.BAD = new UnilayOcrQuality(2, "BAD");
        UnilayOcrQuality.mapIntToEnum.put(UnilayOcrQuality.BAD.value(), UnilayOcrQuality.BAD); 
        UnilayOcrQuality.mapStringToEnum.put(UnilayOcrQuality.BAD.m_str.toUpperCase(), UnilayOcrQuality.BAD); 
        UnilayOcrQuality.MEDIUM = new UnilayOcrQuality(3, "MEDIUM");
        UnilayOcrQuality.mapIntToEnum.put(UnilayOcrQuality.MEDIUM.value(), UnilayOcrQuality.MEDIUM); 
        UnilayOcrQuality.mapStringToEnum.put(UnilayOcrQuality.MEDIUM.m_str.toUpperCase(), UnilayOcrQuality.MEDIUM); 
        UnilayOcrQuality.GOOD = new UnilayOcrQuality(4, "GOOD");
        UnilayOcrQuality.mapIntToEnum.put(UnilayOcrQuality.GOOD.value(), UnilayOcrQuality.GOOD); 
        UnilayOcrQuality.mapStringToEnum.put(UnilayOcrQuality.GOOD.m_str.toUpperCase(), UnilayOcrQuality.GOOD); 
        UnilayOcrQuality.FINE = new UnilayOcrQuality(5, "FINE");
        UnilayOcrQuality.mapIntToEnum.put(UnilayOcrQuality.FINE.value(), UnilayOcrQuality.FINE); 
        UnilayOcrQuality.mapStringToEnum.put(UnilayOcrQuality.FINE.m_str.toUpperCase(), UnilayOcrQuality.FINE); 
        UnilayOcrQuality.m_Values = Array.from(UnilayOcrQuality.mapIntToEnum.values);
        UnilayOcrQuality.m_Keys = Array.from(UnilayOcrQuality.mapIntToEnum.keys);
    }
}


UnilayOcrQuality.static_constructor();

module.exports = UnilayOcrQuality