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