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

/**
 * The operation in progress reported by a <see cref="ZipTestResultHandler"/> during testing.
 */
public class TestOperation implements Comparable<TestOperation> {

    /**
     * Setting up testing.
     */
    public static final TestOperation INITIALISING; // 0

    /**
     * Testing an individual entries header
     */
    public static final TestOperation ENTRYHEADER; // 1

    /**
     * Testing an individual entries data
     */
    public static final TestOperation ENTRYDATA; // 2

    /**
     * Testing an individual entry has completed.
     */
    public static final TestOperation ENTRYCOMPLETE; // 3

    /**
     * Running miscellaneous tests
     */
    public static final TestOperation MISCELLANEOUSTESTS; // 4

    /**
     * Testing is complete
     */
    public static final TestOperation COMPLETE; // 5


    public int value() { return m_val; }
    private int m_val;
    private String m_str;
    private TestOperation(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(TestOperation 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, TestOperation> mapIntToEnum; 
    private static java.util.HashMap<String, TestOperation> mapStringToEnum; 
    private static TestOperation[] m_Values; 
    private static java.util.Collection<Integer> m_Keys; 
    public static TestOperation of(int val) {
        if (mapIntToEnum.containsKey(val)) return mapIntToEnum.get(val);
        TestOperation item = new TestOperation(val, ((Integer)val).toString());
        mapIntToEnum.put(val, item);
        mapStringToEnum.put(item.m_str.toUpperCase(), item);
        return item; 
    }
    public static TestOperation 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 TestOperation[] getValues() {
        return m_Values; 
    }
    static {
        mapIntToEnum = new java.util.HashMap<Integer, TestOperation>();
        mapStringToEnum = new java.util.HashMap<String, TestOperation>();
        INITIALISING = new TestOperation(0, "INITIALISING");
        mapIntToEnum.put(INITIALISING.value(), INITIALISING);
        mapStringToEnum.put(INITIALISING.m_str.toUpperCase(), INITIALISING);
        ENTRYHEADER = new TestOperation(1, "ENTRYHEADER");
        mapIntToEnum.put(ENTRYHEADER.value(), ENTRYHEADER);
        mapStringToEnum.put(ENTRYHEADER.m_str.toUpperCase(), ENTRYHEADER);
        ENTRYDATA = new TestOperation(2, "ENTRYDATA");
        mapIntToEnum.put(ENTRYDATA.value(), ENTRYDATA);
        mapStringToEnum.put(ENTRYDATA.m_str.toUpperCase(), ENTRYDATA);
        ENTRYCOMPLETE = new TestOperation(3, "ENTRYCOMPLETE");
        mapIntToEnum.put(ENTRYCOMPLETE.value(), ENTRYCOMPLETE);
        mapStringToEnum.put(ENTRYCOMPLETE.m_str.toUpperCase(), ENTRYCOMPLETE);
        MISCELLANEOUSTESTS = new TestOperation(4, "MISCELLANEOUSTESTS");
        mapIntToEnum.put(MISCELLANEOUSTESTS.value(), MISCELLANEOUSTESTS);
        mapStringToEnum.put(MISCELLANEOUSTESTS.m_str.toUpperCase(), MISCELLANEOUSTESTS);
        COMPLETE = new TestOperation(5, "COMPLETE");
        mapIntToEnum.put(COMPLETE.value(), COMPLETE);
        mapStringToEnum.put(COMPLETE.m_str.toUpperCase(), COMPLETE);
        java.util.Collection<TestOperation> col = mapIntToEnum.values();
        m_Values = new TestOperation[col.size()];
        col.toArray(m_Values);
        m_Keys = new java.util.ArrayList<Integer>(mapIntToEnum.keySet());
    }
}
