/*
 * 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 operation in progress reported by a <see cref="ZipTestResultHandler"/> during testing.
 */
class TestOperation {

    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 TestOperation) 
            return val;
        if(typeof val === 'string' || val instanceof String) {
            val = val.toUpperCase();
            if(TestOperation.mapStringToEnum.containsKey(val))
                return TestOperation.mapStringToEnum.get(val);
            return null;
        }
        if(TestOperation.mapIntToEnum.containsKey(val))
            return TestOperation.mapIntToEnum.get(val);
        let it = new TestOperation(val, val.toString());
        TestOperation.mapIntToEnum.put(val, it);
        TestOperation.mapStringToEnum.put(val.toString(), it);
        return it;
    }
    static isDefined(val) {
        return TestOperation.m_Keys.indexOf(val) >= 0;
    }
    static getValues() {
        return TestOperation.m_Values;
    }
    static static_constructor() {
        TestOperation.mapIntToEnum = new Hashtable();
        TestOperation.mapStringToEnum = new Hashtable();
        TestOperation.INITIALISING = new TestOperation(0, "INITIALISING");
        TestOperation.mapIntToEnum.put(TestOperation.INITIALISING.value(), TestOperation.INITIALISING); 
        TestOperation.mapStringToEnum.put(TestOperation.INITIALISING.m_str.toUpperCase(), TestOperation.INITIALISING); 
        TestOperation.ENTRYHEADER = new TestOperation(1, "ENTRYHEADER");
        TestOperation.mapIntToEnum.put(TestOperation.ENTRYHEADER.value(), TestOperation.ENTRYHEADER); 
        TestOperation.mapStringToEnum.put(TestOperation.ENTRYHEADER.m_str.toUpperCase(), TestOperation.ENTRYHEADER); 
        TestOperation.ENTRYDATA = new TestOperation(2, "ENTRYDATA");
        TestOperation.mapIntToEnum.put(TestOperation.ENTRYDATA.value(), TestOperation.ENTRYDATA); 
        TestOperation.mapStringToEnum.put(TestOperation.ENTRYDATA.m_str.toUpperCase(), TestOperation.ENTRYDATA); 
        TestOperation.ENTRYCOMPLETE = new TestOperation(3, "ENTRYCOMPLETE");
        TestOperation.mapIntToEnum.put(TestOperation.ENTRYCOMPLETE.value(), TestOperation.ENTRYCOMPLETE); 
        TestOperation.mapStringToEnum.put(TestOperation.ENTRYCOMPLETE.m_str.toUpperCase(), TestOperation.ENTRYCOMPLETE); 
        TestOperation.MISCELLANEOUSTESTS = new TestOperation(4, "MISCELLANEOUSTESTS");
        TestOperation.mapIntToEnum.put(TestOperation.MISCELLANEOUSTESTS.value(), TestOperation.MISCELLANEOUSTESTS); 
        TestOperation.mapStringToEnum.put(TestOperation.MISCELLANEOUSTESTS.m_str.toUpperCase(), TestOperation.MISCELLANEOUSTESTS); 
        TestOperation.COMPLETE = new TestOperation(5, "COMPLETE");
        TestOperation.mapIntToEnum.put(TestOperation.COMPLETE.value(), TestOperation.COMPLETE); 
        TestOperation.mapStringToEnum.put(TestOperation.COMPLETE.m_str.toUpperCase(), TestOperation.COMPLETE); 
        TestOperation.m_Values = Array.from(TestOperation.mapIntToEnum.values);
        TestOperation.m_Keys = Array.from(TestOperation.mapIntToEnum.keys);
    }
}


TestOperation.static_constructor();

module.exports = TestOperation