/*
 * SDK Pullenti Lingvo, 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.ner.link;

/**
 * Тип связи
 */
public class LinkType implements Comparable<LinkType> {

    /**
     * Не определено
     */
    public static final LinkType UNDEFINED; // 0

    /**
     * Рождение
     */
    public static final LinkType BORN; // 1

    /**
     * Родственные
     */
    public static final LinkType FAMILY; // 2

    /**
     * Обучение
     */
    public static final LinkType STUDY; // 3

    /**
     * Работа
     */
    public static final LinkType WORK; // 4

    /**
     * Контакт
     */
    public static final LinkType CONTACT; // 5

    /**
     * Паспорт и т.п.
     */
    public static final LinkType DOCUMENT; // 6

    /**
     * Адрес, локация
     */
    public static final LinkType ADDRESS; // 7

    /**
     * Подразделение
     */
    public static final LinkType UNIT; // 8


    public int value() { return m_val; }
    private int m_val;
    private String m_str;
    private LinkType(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(LinkType 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, LinkType> mapIntToEnum; 
    private static java.util.HashMap<String, LinkType> mapStringToEnum; 
    private static LinkType[] m_Values; 
    private static java.util.Collection<Integer> m_Keys; 
    public static LinkType of(int val) {
        if (mapIntToEnum.containsKey(val)) return mapIntToEnum.get(val);
        LinkType item = new LinkType(val, ((Integer)val).toString());
        mapIntToEnum.put(val, item);
        mapStringToEnum.put(item.m_str.toUpperCase(), item);
        return item; 
    }
    public static LinkType 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 LinkType[] getValues() {
        return m_Values; 
    }
    static {
        mapIntToEnum = new java.util.HashMap<Integer, LinkType>();
        mapStringToEnum = new java.util.HashMap<String, LinkType>();
        UNDEFINED = new LinkType(0, "UNDEFINED");
        mapIntToEnum.put(UNDEFINED.value(), UNDEFINED);
        mapStringToEnum.put(UNDEFINED.m_str.toUpperCase(), UNDEFINED);
        BORN = new LinkType(1, "BORN");
        mapIntToEnum.put(BORN.value(), BORN);
        mapStringToEnum.put(BORN.m_str.toUpperCase(), BORN);
        FAMILY = new LinkType(2, "FAMILY");
        mapIntToEnum.put(FAMILY.value(), FAMILY);
        mapStringToEnum.put(FAMILY.m_str.toUpperCase(), FAMILY);
        STUDY = new LinkType(3, "STUDY");
        mapIntToEnum.put(STUDY.value(), STUDY);
        mapStringToEnum.put(STUDY.m_str.toUpperCase(), STUDY);
        WORK = new LinkType(4, "WORK");
        mapIntToEnum.put(WORK.value(), WORK);
        mapStringToEnum.put(WORK.m_str.toUpperCase(), WORK);
        CONTACT = new LinkType(5, "CONTACT");
        mapIntToEnum.put(CONTACT.value(), CONTACT);
        mapStringToEnum.put(CONTACT.m_str.toUpperCase(), CONTACT);
        DOCUMENT = new LinkType(6, "DOCUMENT");
        mapIntToEnum.put(DOCUMENT.value(), DOCUMENT);
        mapStringToEnum.put(DOCUMENT.m_str.toUpperCase(), DOCUMENT);
        ADDRESS = new LinkType(7, "ADDRESS");
        mapIntToEnum.put(ADDRESS.value(), ADDRESS);
        mapStringToEnum.put(ADDRESS.m_str.toUpperCase(), ADDRESS);
        UNIT = new LinkType(8, "UNIT");
        mapIntToEnum.put(UNIT.value(), UNIT);
        mapStringToEnum.put(UNIT.m_str.toUpperCase(), UNIT);
        java.util.Collection<LinkType> col = mapIntToEnum.values();
        m_Values = new LinkType[col.size()];
        col.toArray(m_Values);
        m_Keys = new java.util.ArrayList<Integer>(mapIntToEnum.keySet());
    }
}
