"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cast_de_nrw_schule_svws_core_data_lehrer_LehrerKatalogLehramtEintrag = exports.LehrerKatalogLehramtEintrag = void 0;
const JavaObject_1 = require("../../../java/lang/JavaObject");
const JavaInteger_1 = require("../../../java/lang/JavaInteger");
class LehrerKatalogLehramtEintrag extends JavaObject_1.JavaObject {
    id = 0;
    kuerzel = "";
    text = "";
    gueltigVon = null;
    gueltigBis = null;
    /**
     * Implementation for method overloads of 'constructor'
     */
    constructor(__param0, __param1, __param2, __param3, __param4) {
        super();
        if ((typeof __param0 === "undefined") && (typeof __param1 === "undefined") && (typeof __param2 === "undefined") && (typeof __param3 === "undefined") && (typeof __param4 === "undefined")) {
        }
        else if (((typeof __param0 !== "undefined") && typeof __param0 === "number") && ((typeof __param1 !== "undefined") && ((__param1 instanceof String) || (typeof __param1 === "string"))) && ((typeof __param2 !== "undefined") && ((__param2 instanceof String) || (typeof __param2 === "string"))) && ((typeof __param3 !== "undefined") && ((__param3 instanceof Number) || (typeof __param3 === "number")) || (__param3 === null)) && ((typeof __param4 !== "undefined") && ((__param4 instanceof Number) || (typeof __param4 === "number")) || (__param4 === null))) {
            let id = __param0;
            let kuerzel = __param1;
            let text = __param2;
            let gueltigVon = (0, JavaInteger_1.cast_java_lang_Integer)(__param3);
            let gueltigBis = (0, JavaInteger_1.cast_java_lang_Integer)(__param4);
            this.id = id;
            this.kuerzel = kuerzel;
            this.text = text;
            this.gueltigVon = gueltigVon;
            this.gueltigBis = gueltigBis;
        }
        else
            throw new Error('invalid method overload');
    }
    isTranspiledInstanceOf(name) {
        return ['de.nrw.schule.svws.core.data.lehrer.LehrerKatalogLehramtEintrag'].includes(name);
    }
    static transpilerFromJSON(json) {
        const obj = JSON.parse(json);
        const result = new LehrerKatalogLehramtEintrag();
        if (typeof obj.id === "undefined")
            throw new Error('invalid json format, missing attribute id');
        result.id = obj.id;
        if (typeof obj.kuerzel === "undefined")
            throw new Error('invalid json format, missing attribute kuerzel');
        result.kuerzel = obj.kuerzel;
        if (typeof obj.text === "undefined")
            throw new Error('invalid json format, missing attribute text');
        result.text = obj.text;
        result.gueltigVon = typeof obj.gueltigVon === "undefined" ? null : obj.gueltigVon;
        result.gueltigBis = typeof obj.gueltigBis === "undefined" ? null : obj.gueltigBis;
        return result;
    }
    static transpilerToJSON(obj) {
        let result = '{';
        result += '"id" : ' + obj.id + ',';
        result += '"kuerzel" : ' + '"' + obj.kuerzel.valueOf() + '"' + ',';
        result += '"text" : ' + '"' + obj.text.valueOf() + '"' + ',';
        result += '"gueltigVon" : ' + ((!obj.gueltigVon) ? 'null' : obj.gueltigVon.valueOf()) + ',';
        result += '"gueltigBis" : ' + ((!obj.gueltigBis) ? 'null' : obj.gueltigBis.valueOf()) + ',';
        result = result.slice(0, -1);
        result += '}';
        return result;
    }
    static transpilerToJSONPatch(obj) {
        let result = '{';
        if (typeof obj.id !== "undefined") {
            result += '"id" : ' + obj.id + ',';
        }
        if (typeof obj.kuerzel !== "undefined") {
            result += '"kuerzel" : ' + '"' + obj.kuerzel.valueOf() + '"' + ',';
        }
        if (typeof obj.text !== "undefined") {
            result += '"text" : ' + '"' + obj.text.valueOf() + '"' + ',';
        }
        if (typeof obj.gueltigVon !== "undefined") {
            result += '"gueltigVon" : ' + ((!obj.gueltigVon) ? 'null' : obj.gueltigVon.valueOf()) + ',';
        }
        if (typeof obj.gueltigBis !== "undefined") {
            result += '"gueltigBis" : ' + ((!obj.gueltigBis) ? 'null' : obj.gueltigBis.valueOf()) + ',';
        }
        result = result.slice(0, -1);
        result += '}';
        return result;
    }
}
exports.LehrerKatalogLehramtEintrag = LehrerKatalogLehramtEintrag;
function cast_de_nrw_schule_svws_core_data_lehrer_LehrerKatalogLehramtEintrag(obj) {
    return obj;
}
exports.cast_de_nrw_schule_svws_core_data_lehrer_LehrerKatalogLehramtEintrag = cast_de_nrw_schule_svws_core_data_lehrer_LehrerKatalogLehramtEintrag;
//# sourceMappingURL=LehrerKatalogLehramtEintrag.js.map