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