/*
 * SDK Pullenti Lingvo, 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#.NET project. 
 * The latest version of the code is available on the site www.pullenti.ru
 */

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

/**
 * Результат обработки
 */
class PersonNormalResult {

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


PersonNormalResult.static_constructor();

module.exports = PersonNormalResult