/*
 * 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");

/**
 * The strategy to apply to testing.
 */
class TestStrategy {

    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 TestStrategy) 
            return val;
        if(typeof val === 'string' || val instanceof String) {
            val = val.toUpperCase();
            if(TestStrategy.mapStringToEnum.containsKey(val))
                return TestStrategy.mapStringToEnum.get(val);
            return null;
        }
        if(TestStrategy.mapIntToEnum.containsKey(val))
            return TestStrategy.mapIntToEnum.get(val);
        let it = new TestStrategy(val, val.toString());
        TestStrategy.mapIntToEnum.put(val, it);
        TestStrategy.mapStringToEnum.put(val.toString(), it);
        return it;
    }
    static isDefined(val) {
        return TestStrategy.m_Keys.indexOf(val) >= 0;
    }
    static getValues() {
        return TestStrategy.m_Values;
    }
    static static_constructor() {
        TestStrategy.mapIntToEnum = new Hashtable();
        TestStrategy.mapStringToEnum = new Hashtable();
        TestStrategy.FINDFIRSTERROR = new TestStrategy(0, "FINDFIRSTERROR");
        TestStrategy.mapIntToEnum.put(TestStrategy.FINDFIRSTERROR.value(), TestStrategy.FINDFIRSTERROR); 
        TestStrategy.mapStringToEnum.put(TestStrategy.FINDFIRSTERROR.m_str.toUpperCase(), TestStrategy.FINDFIRSTERROR); 
        TestStrategy.FINDALLERRORS = new TestStrategy(1, "FINDALLERRORS");
        TestStrategy.mapIntToEnum.put(TestStrategy.FINDALLERRORS.value(), TestStrategy.FINDALLERRORS); 
        TestStrategy.mapStringToEnum.put(TestStrategy.FINDALLERRORS.m_str.toUpperCase(), TestStrategy.FINDALLERRORS); 
        TestStrategy.m_Values = Array.from(TestStrategy.mapIntToEnum.values);
        TestStrategy.m_Keys = Array.from(TestStrategy.mapIntToEnum.keys);
    }
}


TestStrategy.static_constructor();

module.exports = TestStrategy