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

// The possible ways of <see cref="ZipFile.CommitUpdate()">applying updates</see> to an archive.
class FileUpdateMode {

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


FileUpdateMode.static_constructor();

module.exports = FileUpdateMode