/*
 * 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 PersonNormalItemType {

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


PersonNormalItemType.static_constructor();

module.exports = PersonNormalItemType