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

package com.pullenti.unitext.internal.zip;

// Defines the contents of the general bit flags field for an archive entry.
public class GeneralBitFlags implements Comparable<GeneralBitFlags> {

    public static final GeneralBitFlags ENCRYPTED; // 0x0001

    public static final GeneralBitFlags METHOD; // 0x0006

    public static final GeneralBitFlags DESCRIPTOR; // 0x0008

    public static final GeneralBitFlags RESERVEDPKWARE4; // 0x0010

    public static final GeneralBitFlags PATCHED; // 0x0020

    public static final GeneralBitFlags STRONGENCRYPTION; // 0x0040

    public static final GeneralBitFlags UNUSED7; // 0x0080

    public static final GeneralBitFlags UNUSED8; // 0x0100

    public static final GeneralBitFlags UNUSED9; // 0x0200

    public static final GeneralBitFlags UNUSED10; // 0x0400

    public static final GeneralBitFlags UNICODETEXT; // 0x0800

    public static final GeneralBitFlags ENHANCEDCOMPRESS; // 0x1000

    public static final GeneralBitFlags HEADERMASKED; // 0x2000

    public static final GeneralBitFlags RESERVEDPKWARE14; // 0x4000

    public static final GeneralBitFlags RESERVEDPKWARE15; // 0x8000


    public int value() { return m_val; }
    private int m_val;
    private String m_str;
    private GeneralBitFlags(int val, String str) { m_val = val; m_str = str; }
    @Override
    public String toString() {
        if(m_str != null) return m_str;
        return ((Integer)m_val).toString();
    }
    @Override
    public int hashCode() {
        return (int)m_val;
    }
    @Override
    public int compareTo(GeneralBitFlags v) {
        if(m_val < v.m_val) return -1;
        if(m_val > v.m_val) return 1;
        return 0;
    }
    private static java.util.HashMap<Integer, GeneralBitFlags> mapIntToEnum; 
    private static java.util.HashMap<String, GeneralBitFlags> mapStringToEnum; 
    private static GeneralBitFlags[] m_Values; 
    private static java.util.Collection<Integer> m_Keys; 
    public static GeneralBitFlags of(int val) {
        if (mapIntToEnum.containsKey(val)) return mapIntToEnum.get(val);
        GeneralBitFlags item = new GeneralBitFlags(val, ((Integer)val).toString());
        mapIntToEnum.put(val, item);
        mapStringToEnum.put(item.m_str.toUpperCase(), item);
        return item; 
    }
    public static GeneralBitFlags of(String str) {
        str = str.toUpperCase(); 
        if (mapStringToEnum.containsKey(str)) return mapStringToEnum.get(str);
        return null; 
    }
    public static boolean isDefined(Object val) {
        if(val instanceof Integer) return m_Keys.contains((Integer)val); 
        return false; 
    }
    public static GeneralBitFlags[] getValues() {
        return m_Values; 
    }
    static {
        mapIntToEnum = new java.util.HashMap<Integer, GeneralBitFlags>();
        mapStringToEnum = new java.util.HashMap<String, GeneralBitFlags>();
        ENCRYPTED = new GeneralBitFlags(0x0001, "ENCRYPTED");
        mapIntToEnum.put(ENCRYPTED.value(), ENCRYPTED);
        mapStringToEnum.put(ENCRYPTED.m_str.toUpperCase(), ENCRYPTED);
        METHOD = new GeneralBitFlags(0x0006, "METHOD");
        mapIntToEnum.put(METHOD.value(), METHOD);
        mapStringToEnum.put(METHOD.m_str.toUpperCase(), METHOD);
        DESCRIPTOR = new GeneralBitFlags(0x0008, "DESCRIPTOR");
        mapIntToEnum.put(DESCRIPTOR.value(), DESCRIPTOR);
        mapStringToEnum.put(DESCRIPTOR.m_str.toUpperCase(), DESCRIPTOR);
        RESERVEDPKWARE4 = new GeneralBitFlags(0x0010, "RESERVEDPKWARE4");
        mapIntToEnum.put(RESERVEDPKWARE4.value(), RESERVEDPKWARE4);
        mapStringToEnum.put(RESERVEDPKWARE4.m_str.toUpperCase(), RESERVEDPKWARE4);
        PATCHED = new GeneralBitFlags(0x0020, "PATCHED");
        mapIntToEnum.put(PATCHED.value(), PATCHED);
        mapStringToEnum.put(PATCHED.m_str.toUpperCase(), PATCHED);
        STRONGENCRYPTION = new GeneralBitFlags(0x0040, "STRONGENCRYPTION");
        mapIntToEnum.put(STRONGENCRYPTION.value(), STRONGENCRYPTION);
        mapStringToEnum.put(STRONGENCRYPTION.m_str.toUpperCase(), STRONGENCRYPTION);
        UNUSED7 = new GeneralBitFlags(0x0080, "UNUSED7");
        mapIntToEnum.put(UNUSED7.value(), UNUSED7);
        mapStringToEnum.put(UNUSED7.m_str.toUpperCase(), UNUSED7);
        UNUSED8 = new GeneralBitFlags(0x0100, "UNUSED8");
        mapIntToEnum.put(UNUSED8.value(), UNUSED8);
        mapStringToEnum.put(UNUSED8.m_str.toUpperCase(), UNUSED8);
        UNUSED9 = new GeneralBitFlags(0x0200, "UNUSED9");
        mapIntToEnum.put(UNUSED9.value(), UNUSED9);
        mapStringToEnum.put(UNUSED9.m_str.toUpperCase(), UNUSED9);
        UNUSED10 = new GeneralBitFlags(0x0400, "UNUSED10");
        mapIntToEnum.put(UNUSED10.value(), UNUSED10);
        mapStringToEnum.put(UNUSED10.m_str.toUpperCase(), UNUSED10);
        UNICODETEXT = new GeneralBitFlags(0x0800, "UNICODETEXT");
        mapIntToEnum.put(UNICODETEXT.value(), UNICODETEXT);
        mapStringToEnum.put(UNICODETEXT.m_str.toUpperCase(), UNICODETEXT);
        ENHANCEDCOMPRESS = new GeneralBitFlags(0x1000, "ENHANCEDCOMPRESS");
        mapIntToEnum.put(ENHANCEDCOMPRESS.value(), ENHANCEDCOMPRESS);
        mapStringToEnum.put(ENHANCEDCOMPRESS.m_str.toUpperCase(), ENHANCEDCOMPRESS);
        HEADERMASKED = new GeneralBitFlags(0x2000, "HEADERMASKED");
        mapIntToEnum.put(HEADERMASKED.value(), HEADERMASKED);
        mapStringToEnum.put(HEADERMASKED.m_str.toUpperCase(), HEADERMASKED);
        RESERVEDPKWARE14 = new GeneralBitFlags(0x4000, "RESERVEDPKWARE14");
        mapIntToEnum.put(RESERVEDPKWARE14.value(), RESERVEDPKWARE14);
        mapStringToEnum.put(RESERVEDPKWARE14.m_str.toUpperCase(), RESERVEDPKWARE14);
        RESERVEDPKWARE15 = new GeneralBitFlags(0x8000, "RESERVEDPKWARE15");
        mapIntToEnum.put(RESERVEDPKWARE15.value(), RESERVEDPKWARE15);
        mapStringToEnum.put(RESERVEDPKWARE15.m_str.toUpperCase(), RESERVEDPKWARE15);
        java.util.Collection<GeneralBitFlags> col = mapIntToEnum.values();
        m_Values = new GeneralBitFlags[col.size()];
        col.toArray(m_Values);
        m_Keys = new java.util.ArrayList<Integer>(mapIntToEnum.keySet());
    }
}
