123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.cast_de_nrw_schule_svws_core_data_abschluss_AbschlussErgebnis = exports.AbschlussErgebnis = void 0;
- const JavaObject_1 = require("../../../java/lang/JavaObject");
- class AbschlussErgebnis extends JavaObject_1.JavaObject {
- erworben = false;
- abschluss = null;
- npFaecher = null;
- log = null;
- constructor() {
- super();
- }
- isTranspiledInstanceOf(name) {
- return ['de.nrw.schule.svws.core.data.abschluss.AbschlussErgebnis'].includes(name);
- }
- static transpilerFromJSON(json) {
- const obj = JSON.parse(json);
- const result = new AbschlussErgebnis();
- if (typeof obj.erworben === "undefined")
- throw new Error('invalid json format, missing attribute erworben');
- result.erworben = obj.erworben;
- result.abschluss = typeof obj.abschluss === "undefined" ? null : obj.abschluss;
- if (!!obj.npFaecher) {
- for (let elem of obj.npFaecher) {
- result.npFaecher?.add(elem);
- }
- }
- if (!!obj.log) {
- for (let elem of obj.log) {
- result.log?.add(elem);
- }
- }
- return result;
- }
- static transpilerToJSON(obj) {
- let result = '{';
- result += '"erworben" : ' + obj.erworben + ',';
- result += '"abschluss" : ' + ((!obj.abschluss) ? 'null' : '"' + obj.abschluss.valueOf() + '"') + ',';
- if (!obj.npFaecher) {
- result += '[]';
- }
- else {
- result += '[ ';
- for (let i = 0; i < obj.npFaecher.size(); i++) {
- let elem = obj.npFaecher.get(i);
- result += '"' + elem + '"';
- if (i < obj.npFaecher.size() - 1)
- result += ',';
- }
- result += ' ]' + ',';
- }
- if (!obj.log) {
- result += '[]';
- }
- else {
- result += '[ ';
- for (let i = 0; i < obj.log.size(); i++) {
- let elem = obj.log.get(i);
- result += '"' + elem + '"';
- if (i < obj.log.size() - 1)
- result += ',';
- }
- result += ' ]' + ',';
- }
- result = result.slice(0, -1);
- result += '}';
- return result;
- }
- static transpilerToJSONPatch(obj) {
- let result = '{';
- if (typeof obj.erworben !== "undefined") {
- result += '"erworben" : ' + obj.erworben + ',';
- }
- if (typeof obj.abschluss !== "undefined") {
- result += '"abschluss" : ' + ((!obj.abschluss) ? 'null' : '"' + obj.abschluss.valueOf() + '"') + ',';
- }
- if (typeof obj.npFaecher !== "undefined") {
- if (!obj.npFaecher) {
- result += '[]';
- }
- else {
- result += '[ ';
- for (let i = 0; i < obj.npFaecher.size(); i++) {
- let elem = obj.npFaecher.get(i);
- result += '"' + elem + '"';
- if (i < obj.npFaecher.size() - 1)
- result += ',';
- }
- result += ' ]' + ',';
- }
- }
- if (typeof obj.log !== "undefined") {
- if (!obj.log) {
- result += '[]';
- }
- else {
- result += '[ ';
- for (let i = 0; i < obj.log.size(); i++) {
- let elem = obj.log.get(i);
- result += '"' + elem + '"';
- if (i < obj.log.size() - 1)
- result += ',';
- }
- result += ' ]' + ',';
- }
- }
- result = result.slice(0, -1);
- result += '}';
- return result;
- }
- }
- exports.AbschlussErgebnis = AbschlussErgebnis;
- function cast_de_nrw_schule_svws_core_data_abschluss_AbschlussErgebnis(obj) {
- return obj;
- }
- exports.cast_de_nrw_schule_svws_core_data_abschluss_AbschlussErgebnis = cast_de_nrw_schule_svws_core_data_abschluss_AbschlussErgebnis;
- //# sourceMappingURL=AbschlussErgebnis.js.map
|