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

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


FileFormatClass.static_constructor();

module.exports = FileFormatClass