"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cast_de_nrw_schule_svws_core_types_Abschluss = exports.Abschluss = void 0;
const JavaObject_1 = require("../../java/lang/JavaObject");
class Abschluss extends JavaObject_1.JavaObject {
    /** the name of the enumeration value */
    __name;
    /** the ordinal value for the enumeration value */
    __ordinal;
    /** an array containing all values of this enumeration */
    static all_values_by_ordinal = [];
    /** an array containing all values of this enumeration indexed by their name*/
    static all_values_by_name = new Map();
    static OHNE_ABSCHLUSS = new Abschluss("OHNE_ABSCHLUSS", 0);
    static HA9 = new Abschluss("HA9", 1);
    static HA10 = new Abschluss("HA10", 2);
    static MSA = new Abschluss("MSA", 3);
    static MSA_Q = new Abschluss("MSA_Q", 4);
    constructor(name, ordinal) {
        super();
        this.__name = name;
        this.__ordinal = ordinal;
        Abschluss.all_values_by_ordinal.push(this);
        Abschluss.all_values_by_name.set(name, this);
    }
    /**
     * Prüft, ob dieser Abschluss dem im String-Parameter str übergebenen
     * Abschluss entspricht.
     *
     * @param str   der Name des Abschlusses für den Vergleich als String
     *
     * @return true, falls beide Abschlüsse übereinstimmen und ansonsten false
     */
    is(str) {
        if (str === null)
            return false;
        try {
            let other = Abschluss.valueOf(str);
            return JavaObject_1.JavaObject.equalsTranspiler(this, (other));
        }
        catch (e) {
            return false;
        }
    }
    /**
     * Returns the name of this enumeration value.
     *
     * @returns the name
     */
    name() {
        return this.__name;
    }
    /**
     * Returns the ordinal value of this enumeration value.
     *
     * @returns the ordinal value
     */
    ordinal() {
        return this.__ordinal;
    }
    /**
     * Returns the name of this enumeration value.
     *
     * @returns the name
     */
    toString() {
        return this.__name;
    }
    /**
     * Returns true if this and the other enumeration values are equal.
     *
     * @param other   the other enumeration value
     *
     * @returns true if they are equal and false otherwise
     */
    equals(other) {
        if (!(other instanceof Abschluss))
            return false;
        return this === other;
    }
    /**
     * Returns the ordinal value as hashcode, since the ordinal value is unique.
     *
     * @returns the ordinal value as hashcode
     */
    hashCode() {
        return this.__ordinal;
    }
    /**
     * Compares this enumeration value with the other enumeration value by their ordinal value.
     *
     * @param other   the other enumeration value
     *
     * @returns a negative, zero or postive value as this enumeration value is less than, equal to
     *          or greater than the other enumeration value
     */
    compareTo(other) {
        return this.__ordinal - other.__ordinal;
    }
    /**
     * Returns an array with enumeration values.
     *
     * @returns the array with enumeration values
     */
    static values() {
        return [...this.all_values_by_ordinal];
    }
    /**
     * Returns the enumeration value with the specified name.
     *
     * @param name   the name of the enumeration value
     *
     * @returns the enumeration values or null
     */
    static valueOf(name) {
        let tmp = this.all_values_by_name.get(name);
        return (!tmp) ? null : tmp;
    }
    isTranspiledInstanceOf(name) {
        return ['de.nrw.schule.svws.core.types.Abschluss'].includes(name);
    }
}
exports.Abschluss = Abschluss;
function cast_de_nrw_schule_svws_core_types_Abschluss(obj) {
    return obj;
}
exports.cast_de_nrw_schule_svws_core_types_Abschluss = cast_de_nrw_schule_svws_core_types_Abschluss;
//# sourceMappingURL=Abschluss.js.map