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

    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 UnitextContainerType) 
            return val;
        if(typeof val === 'string' || val instanceof String) {
            val = val.toUpperCase();
            if(UnitextContainerType.mapStringToEnum.containsKey(val))
                return UnitextContainerType.mapStringToEnum.get(val);
            return null;
        }
        if(UnitextContainerType.mapIntToEnum.containsKey(val))
            return UnitextContainerType.mapIntToEnum.get(val);
        let it = new UnitextContainerType(val, val.toString());
        UnitextContainerType.mapIntToEnum.put(val, it);
        UnitextContainerType.mapStringToEnum.put(val.toString(), it);
        return it;
    }
    static isDefined(val) {
        return UnitextContainerType.m_Keys.indexOf(val) >= 0;
    }
    static getValues() {
        return UnitextContainerType.m_Values;
    }
    static static_constructor() {
        UnitextContainerType.mapIntToEnum = new Hashtable();
        UnitextContainerType.mapStringToEnum = new Hashtable();
        UnitextContainerType.UNDEFINED = new UnitextContainerType(0, "UNDEFINED");
        UnitextContainerType.mapIntToEnum.put(UnitextContainerType.UNDEFINED.value(), UnitextContainerType.UNDEFINED); 
        UnitextContainerType.mapStringToEnum.put(UnitextContainerType.UNDEFINED.m_str.toUpperCase(), UnitextContainerType.UNDEFINED); 
        UnitextContainerType.SHAPE = new UnitextContainerType(1, "SHAPE");
        UnitextContainerType.mapIntToEnum.put(UnitextContainerType.SHAPE.value(), UnitextContainerType.SHAPE); 
        UnitextContainerType.mapStringToEnum.put(UnitextContainerType.SHAPE.m_str.toUpperCase(), UnitextContainerType.SHAPE); 
        UnitextContainerType.FORMULA = new UnitextContainerType(2, "FORMULA");
        UnitextContainerType.mapIntToEnum.put(UnitextContainerType.FORMULA.value(), UnitextContainerType.FORMULA); 
        UnitextContainerType.mapStringToEnum.put(UnitextContainerType.FORMULA.m_str.toUpperCase(), UnitextContainerType.FORMULA); 
        UnitextContainerType.CONTENTCONTROL = new UnitextContainerType(3, "CONTENTCONTROL");
        UnitextContainerType.mapIntToEnum.put(UnitextContainerType.CONTENTCONTROL.value(), UnitextContainerType.CONTENTCONTROL); 
        UnitextContainerType.mapStringToEnum.put(UnitextContainerType.CONTENTCONTROL.m_str.toUpperCase(), UnitextContainerType.CONTENTCONTROL); 
        UnitextContainerType.MONOSPACE = new UnitextContainerType(4, "MONOSPACE");
        UnitextContainerType.mapIntToEnum.put(UnitextContainerType.MONOSPACE.value(), UnitextContainerType.MONOSPACE); 
        UnitextContainerType.mapStringToEnum.put(UnitextContainerType.MONOSPACE.m_str.toUpperCase(), UnitextContainerType.MONOSPACE); 
        UnitextContainerType.HIGHLIGHTING = new UnitextContainerType(5, "HIGHLIGHTING");
        UnitextContainerType.mapIntToEnum.put(UnitextContainerType.HIGHLIGHTING.value(), UnitextContainerType.HIGHLIGHTING); 
        UnitextContainerType.mapStringToEnum.put(UnitextContainerType.HIGHLIGHTING.m_str.toUpperCase(), UnitextContainerType.HIGHLIGHTING); 
        UnitextContainerType.KEYWORD = new UnitextContainerType(6, "KEYWORD");
        UnitextContainerType.mapIntToEnum.put(UnitextContainerType.KEYWORD.value(), UnitextContainerType.KEYWORD); 
        UnitextContainerType.mapStringToEnum.put(UnitextContainerType.KEYWORD.m_str.toUpperCase(), UnitextContainerType.KEYWORD); 
        UnitextContainerType.NUMBER = new UnitextContainerType(7, "NUMBER");
        UnitextContainerType.mapIntToEnum.put(UnitextContainerType.NUMBER.value(), UnitextContainerType.NUMBER); 
        UnitextContainerType.mapStringToEnum.put(UnitextContainerType.NUMBER.m_str.toUpperCase(), UnitextContainerType.NUMBER); 
        UnitextContainerType.NAME = new UnitextContainerType(8, "NAME");
        UnitextContainerType.mapIntToEnum.put(UnitextContainerType.NAME.value(), UnitextContainerType.NAME); 
        UnitextContainerType.mapStringToEnum.put(UnitextContainerType.NAME.m_str.toUpperCase(), UnitextContainerType.NAME); 
        UnitextContainerType.EDITION = new UnitextContainerType(9, "EDITION");
        UnitextContainerType.mapIntToEnum.put(UnitextContainerType.EDITION.value(), UnitextContainerType.EDITION); 
        UnitextContainerType.mapStringToEnum.put(UnitextContainerType.EDITION.m_str.toUpperCase(), UnitextContainerType.EDITION); 
        UnitextContainerType.COMMENT = new UnitextContainerType(10, "COMMENT");
        UnitextContainerType.mapIntToEnum.put(UnitextContainerType.COMMENT.value(), UnitextContainerType.COMMENT); 
        UnitextContainerType.mapStringToEnum.put(UnitextContainerType.COMMENT.m_str.toUpperCase(), UnitextContainerType.COMMENT); 
        UnitextContainerType.DIRECTIVE = new UnitextContainerType(11, "DIRECTIVE");
        UnitextContainerType.mapIntToEnum.put(UnitextContainerType.DIRECTIVE.value(), UnitextContainerType.DIRECTIVE); 
        UnitextContainerType.mapStringToEnum.put(UnitextContainerType.DIRECTIVE.m_str.toUpperCase(), UnitextContainerType.DIRECTIVE); 
        UnitextContainerType.HEAD = new UnitextContainerType(12, "HEAD");
        UnitextContainerType.mapIntToEnum.put(UnitextContainerType.HEAD.value(), UnitextContainerType.HEAD); 
        UnitextContainerType.mapStringToEnum.put(UnitextContainerType.HEAD.m_str.toUpperCase(), UnitextContainerType.HEAD); 
        UnitextContainerType.TAIL = new UnitextContainerType(13, "TAIL");
        UnitextContainerType.mapIntToEnum.put(UnitextContainerType.TAIL.value(), UnitextContainerType.TAIL); 
        UnitextContainerType.mapStringToEnum.put(UnitextContainerType.TAIL.m_str.toUpperCase(), UnitextContainerType.TAIL); 
        UnitextContainerType.RIGHTALIGN = new UnitextContainerType(14, "RIGHTALIGN");
        UnitextContainerType.mapIntToEnum.put(UnitextContainerType.RIGHTALIGN.value(), UnitextContainerType.RIGHTALIGN); 
        UnitextContainerType.mapStringToEnum.put(UnitextContainerType.RIGHTALIGN.m_str.toUpperCase(), UnitextContainerType.RIGHTALIGN); 
        UnitextContainerType.ENTITY = new UnitextContainerType(15, "ENTITY");
        UnitextContainerType.mapIntToEnum.put(UnitextContainerType.ENTITY.value(), UnitextContainerType.ENTITY); 
        UnitextContainerType.mapStringToEnum.put(UnitextContainerType.ENTITY.m_str.toUpperCase(), UnitextContainerType.ENTITY); 
        UnitextContainerType.USERTYPE = new UnitextContainerType(16, "USERTYPE");
        UnitextContainerType.mapIntToEnum.put(UnitextContainerType.USERTYPE.value(), UnitextContainerType.USERTYPE); 
        UnitextContainerType.mapStringToEnum.put(UnitextContainerType.USERTYPE.m_str.toUpperCase(), UnitextContainerType.USERTYPE); 
        UnitextContainerType.m_Values = Array.from(UnitextContainerType.mapIntToEnum.values);
        UnitextContainerType.m_Keys = Array.from(UnitextContainerType.mapIntToEnum.keys);
    }
}


UnitextContainerType.static_constructor();

module.exports = UnitextContainerType