All Downloads are FREE. Search and download functionalities are using the official Maven repository.

mmarquee.automation.uiautomation.RowOrColumnMajor Maven / Gradle / Ivy

There is a newer version: 0.7.0
Show newest version
package mmarquee.automation.uiautomation;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Mark Humphreys on 12/09/2016.
 */
public enum RowOrColumnMajor {
    RowMajor(0),
    ColumnMajor(1),
    Indeterminate(2);

    private int value;

    public int getValue() {
        return this.value;
    }

    RowOrColumnMajor (int value) {
        this.value = value;
    }

    private static final Map intToTypeMap = new HashMap();
    static {
        for (RowOrColumnMajor type : RowOrColumnMajor.values()) {
            intToTypeMap.put(type.value, type);
        }
    }

    /**
     * Gets the enumeration from the given integer
     * @param i The given integer
     * @return The value (as an RowOrColumnMajor)
     */
    public static RowOrColumnMajor fromInt(int i) {
        RowOrColumnMajor type = intToTypeMap.get(Integer.valueOf(i));
        if (type == null)
            return RowOrColumnMajor.Indeterminate;
        return type;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy