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

    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 ZipEntryKnown) 
            return val;
        if(typeof val === 'string' || val instanceof String) {
            val = val.toUpperCase();
            if(ZipEntryKnown.mapStringToEnum.containsKey(val))
                return ZipEntryKnown.mapStringToEnum.get(val);
            return null;
        }
        if(ZipEntryKnown.mapIntToEnum.containsKey(val))
            return ZipEntryKnown.mapIntToEnum.get(val);
        let it = new ZipEntryKnown(val, val.toString());
        ZipEntryKnown.mapIntToEnum.put(val, it);
        ZipEntryKnown.mapStringToEnum.put(val.toString(), it);
        return it;
    }
    static isDefined(val) {
        return ZipEntryKnown.m_Keys.indexOf(val) >= 0;
    }
    static getValues() {
        return ZipEntryKnown.m_Values;
    }
    static static_constructor() {
        ZipEntryKnown.mapIntToEnum = new Hashtable();
        ZipEntryKnown.mapStringToEnum = new Hashtable();
        ZipEntryKnown.NONE = new ZipEntryKnown(0, "NONE");
        ZipEntryKnown.mapIntToEnum.put(ZipEntryKnown.NONE.value(), ZipEntryKnown.NONE); 
        ZipEntryKnown.mapStringToEnum.put(ZipEntryKnown.NONE.m_str.toUpperCase(), ZipEntryKnown.NONE); 
        ZipEntryKnown.SIZE = new ZipEntryKnown(0x01, "SIZE");
        ZipEntryKnown.mapIntToEnum.put(ZipEntryKnown.SIZE.value(), ZipEntryKnown.SIZE); 
        ZipEntryKnown.mapStringToEnum.put(ZipEntryKnown.SIZE.m_str.toUpperCase(), ZipEntryKnown.SIZE); 
        ZipEntryKnown.COMPRESSEDSIZE = new ZipEntryKnown(0x02, "COMPRESSEDSIZE");
        ZipEntryKnown.mapIntToEnum.put(ZipEntryKnown.COMPRESSEDSIZE.value(), ZipEntryKnown.COMPRESSEDSIZE); 
        ZipEntryKnown.mapStringToEnum.put(ZipEntryKnown.COMPRESSEDSIZE.m_str.toUpperCase(), ZipEntryKnown.COMPRESSEDSIZE); 
        ZipEntryKnown.CRC = new ZipEntryKnown(0x04, "CRC");
        ZipEntryKnown.mapIntToEnum.put(ZipEntryKnown.CRC.value(), ZipEntryKnown.CRC); 
        ZipEntryKnown.mapStringToEnum.put(ZipEntryKnown.CRC.m_str.toUpperCase(), ZipEntryKnown.CRC); 
        ZipEntryKnown.TIME = new ZipEntryKnown(0x08, "TIME");
        ZipEntryKnown.mapIntToEnum.put(ZipEntryKnown.TIME.value(), ZipEntryKnown.TIME); 
        ZipEntryKnown.mapStringToEnum.put(ZipEntryKnown.TIME.m_str.toUpperCase(), ZipEntryKnown.TIME); 
        ZipEntryKnown.EXTERNALATTRIBUTES = new ZipEntryKnown(0x10, "EXTERNALATTRIBUTES");
        ZipEntryKnown.mapIntToEnum.put(ZipEntryKnown.EXTERNALATTRIBUTES.value(), ZipEntryKnown.EXTERNALATTRIBUTES); 
        ZipEntryKnown.mapStringToEnum.put(ZipEntryKnown.EXTERNALATTRIBUTES.m_str.toUpperCase(), ZipEntryKnown.EXTERNALATTRIBUTES); 
        ZipEntryKnown.m_Values = Array.from(ZipEntryKnown.mapIntToEnum.values);
        ZipEntryKnown.m_Keys = Array.from(ZipEntryKnown.mapIntToEnum.keys);
    }
}


ZipEntryKnown.static_constructor();

module.exports = ZipEntryKnown