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