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