"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cast_de_nrw_schule_svws_core_data_gost_GostBlockungListeneintrag = exports.GostBlockungListeneintrag = void 0;
const JavaObject_1 = require("../../../java/lang/JavaObject");
class GostBlockungListeneintrag extends JavaObject_1.JavaObject {
    id = -1;
    name = "Neue Blockung";
    gostHalbjahr = 0;
    constructor() {
        super();
    }
    isTranspiledInstanceOf(name) {
        return ['de.nrw.schule.svws.core.data.gost.GostBlockungListeneintrag'].includes(name);
    }
    static transpilerFromJSON(json) {
        const obj = JSON.parse(json);
        const result = new GostBlockungListeneintrag();
        if (typeof obj.id === "undefined")
            throw new Error('invalid json format, missing attribute id');
        result.id = obj.id;
        if (typeof obj.name === "undefined")
            throw new Error('invalid json format, missing attribute name');
        result.name = obj.name;
        if (typeof obj.gostHalbjahr === "undefined")
            throw new Error('invalid json format, missing attribute gostHalbjahr');
        result.gostHalbjahr = obj.gostHalbjahr;
        return result;
    }
    static transpilerToJSON(obj) {
        let result = '{';
        result += '"id" : ' + obj.id + ',';
        result += '"name" : ' + '"' + obj.name.valueOf() + '"' + ',';
        result += '"gostHalbjahr" : ' + obj.gostHalbjahr + ',';
        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.name !== "undefined") {
            result += '"name" : ' + '"' + obj.name.valueOf() + '"' + ',';
        }
        if (typeof obj.gostHalbjahr !== "undefined") {
            result += '"gostHalbjahr" : ' + obj.gostHalbjahr + ',';
        }
        result = result.slice(0, -1);
        result += '}';
        return result;
    }
}
exports.GostBlockungListeneintrag = GostBlockungListeneintrag;
function cast_de_nrw_schule_svws_core_data_gost_GostBlockungListeneintrag(obj) {
    return obj;
}
exports.cast_de_nrw_schule_svws_core_data_gost_GostBlockungListeneintrag = cast_de_nrw_schule_svws_core_data_gost_GostBlockungListeneintrag;
//# sourceMappingURL=GostBlockungListeneintrag.js.map