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

// Strategies for deflater
class DeflateStrategy {

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


DeflateStrategy.static_constructor();

module.exports = DeflateStrategy