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

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


UnitextPlaintextType.static_constructor();

module.exports = UnitextPlaintextType