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

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


UnitextDocblockType.static_constructor();

module.exports = UnitextDocblockType