/*
 * 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");

// Compound File storage object type.
class CompoundFileObjectType {

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


CompoundFileObjectType.static_constructor();

module.exports = CompoundFileObjectType