"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cast_de_nrw_schule_svws_core_data_kursblockung_KursblockungOutputKursZuSchiene = exports.KursblockungOutputKursZuSchiene = void 0;
const JavaObject_1 = require("../../../java/lang/JavaObject");
class KursblockungOutputKursZuSchiene extends JavaObject_1.JavaObject {
    enmRevision = -1;
    kurs = 0;
    schienen = Array(0).fill(0);
    constructor() {
        super();
    }
    isTranspiledInstanceOf(name) {
        return ['de.nrw.schule.svws.core.data.kursblockung.KursblockungOutputKursZuSchiene'].includes(name);
    }
    static transpilerFromJSON(json) {
        const obj = JSON.parse(json);
        const result = new KursblockungOutputKursZuSchiene();
        if (typeof obj.enmRevision === "undefined")
            throw new Error('invalid json format, missing attribute enmRevision');
        result.enmRevision = obj.enmRevision;
        if (typeof obj.kurs === "undefined")
            throw new Error('invalid json format, missing attribute kurs');
        result.kurs = obj.kurs;
        for (let i = 0; i < obj.schienen.length; i++) {
            result.schienen[i] = obj.schienen[i];
        }
        return result;
    }
    static transpilerToJSON(obj) {
        let result = '{';
        result += '"enmRevision" : ' + obj.enmRevision + ',';
        result += '"kurs" : ' + obj.kurs + ',';
        if (!obj.schienen) {
            result += '[]';
        }
        else {
            result += '[ ';
            for (let i = 0; i < obj.schienen.length; i++) {
                let elem = obj.schienen[i];
                result += JSON.stringify(elem);
                if (i < obj.schienen.length - 1)
                    result += ',';
            }
            result += ' ]' + ',';
        }
        result = result.slice(0, -1);
        result += '}';
        return result;
    }
    static transpilerToJSONPatch(obj) {
        let result = '{';
        if (typeof obj.enmRevision !== "undefined") {
            result += '"enmRevision" : ' + obj.enmRevision + ',';
        }
        if (typeof obj.kurs !== "undefined") {
            result += '"kurs" : ' + obj.kurs + ',';
        }
        if (typeof obj.schienen !== "undefined") {
            let a = obj.schienen;
            if (!a) {
                result += '[]';
            }
            else {
                result += '[ ';
                for (let i = 0; i < a.length; i++) {
                    let elem = a[i];
                    result += JSON.stringify(elem);
                    if (i < a.length - 1)
                        result += ',';
                }
                result += ' ]' + ',';
            }
        }
        result = result.slice(0, -1);
        result += '}';
        return result;
    }
}
exports.KursblockungOutputKursZuSchiene = KursblockungOutputKursZuSchiene;
function cast_de_nrw_schule_svws_core_data_kursblockung_KursblockungOutputKursZuSchiene(obj) {
    return obj;
}
exports.cast_de_nrw_schule_svws_core_data_kursblockung_KursblockungOutputKursZuSchiene = cast_de_nrw_schule_svws_core_data_kursblockung_KursblockungOutputKursZuSchiene;
//# sourceMappingURL=KursblockungOutputKursZuSchiene.js.map