"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cast_de_nrw_schule_svws_core_data_gost_GostBelegpruefungsdaten = exports.GostBelegpruefungsdaten = void 0;
const JavaObject_1 = require("../../../java/lang/JavaObject");
const GostFach_1 = require("../../../core/data/gost/GostFach");
const Vector_1 = require("../../../java/util/Vector");
const Abiturdaten_1 = require("../../../core/data/gost/Abiturdaten");
class GostBelegpruefungsdaten extends JavaObject_1.JavaObject {
    abiturdaten = null;
    gostFaecher = new Vector_1.Vector();
    constructor() {
        super();
    }
    isTranspiledInstanceOf(name) {
        return ['de.nrw.schule.svws.core.data.gost.GostBelegpruefungsdaten'].includes(name);
    }
    static transpilerFromJSON(json) {
        const obj = JSON.parse(json);
        const result = new GostBelegpruefungsdaten();
        result.abiturdaten = typeof obj.abiturdaten === "undefined" ? null : Abiturdaten_1.Abiturdaten.transpilerFromJSON(JSON.stringify(obj.abiturdaten));
        if (!!obj.gostFaecher) {
            for (let elem of obj.gostFaecher) {
                result.gostFaecher?.add(GostFach_1.GostFach.transpilerFromJSON(JSON.stringify(elem)));
            }
        }
        return result;
    }
    static transpilerToJSON(obj) {
        let result = '{';
        result += '"abiturdaten" : ' + ((!obj.abiturdaten) ? 'null' : Abiturdaten_1.Abiturdaten.transpilerToJSON(obj.abiturdaten)) + ',';
        if (!obj.gostFaecher) {
            result += '[]';
        }
        else {
            result += '[ ';
            for (let i = 0; i < obj.gostFaecher.size(); i++) {
                let elem = obj.gostFaecher.get(i);
                result += GostFach_1.GostFach.transpilerToJSON(elem);
                if (i < obj.gostFaecher.size() - 1)
                    result += ',';
            }
            result += ' ]' + ',';
        }
        result = result.slice(0, -1);
        result += '}';
        return result;
    }
    static transpilerToJSONPatch(obj) {
        let result = '{';
        if (typeof obj.abiturdaten !== "undefined") {
            result += '"abiturdaten" : ' + ((!obj.abiturdaten) ? 'null' : Abiturdaten_1.Abiturdaten.transpilerToJSON(obj.abiturdaten)) + ',';
        }
        if (typeof obj.gostFaecher !== "undefined") {
            if (!obj.gostFaecher) {
                result += '[]';
            }
            else {
                result += '[ ';
                for (let i = 0; i < obj.gostFaecher.size(); i++) {
                    let elem = obj.gostFaecher.get(i);
                    result += GostFach_1.GostFach.transpilerToJSON(elem);
                    if (i < obj.gostFaecher.size() - 1)
                        result += ',';
                }
                result += ' ]' + ',';
            }
        }
        result = result.slice(0, -1);
        result += '}';
        return result;
    }
}
exports.GostBelegpruefungsdaten = GostBelegpruefungsdaten;
function cast_de_nrw_schule_svws_core_data_gost_GostBelegpruefungsdaten(obj) {
    return obj;
}
exports.cast_de_nrw_schule_svws_core_data_gost_GostBelegpruefungsdaten = cast_de_nrw_schule_svws_core_data_gost_GostBelegpruefungsdaten;
//# sourceMappingURL=GostBelegpruefungsdaten.js.map