123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279 |
- import { JavaObject, cast_java_lang_Object } from '../../../java/lang/JavaObject';
- import { KursblockungInputKurs, cast_de_nrw_schule_svws_core_data_kursblockung_KursblockungInputKurs } from '../../../core/data/kursblockung/KursblockungInputKurs';
- import { KursblockungInputSchueler, cast_de_nrw_schule_svws_core_data_kursblockung_KursblockungInputSchueler } from '../../../core/data/kursblockung/KursblockungInputSchueler';
- import { KursblockungInputRegel, cast_de_nrw_schule_svws_core_data_kursblockung_KursblockungInputRegel } from '../../../core/data/kursblockung/KursblockungInputRegel';
- import { KursblockungInputKursart, cast_de_nrw_schule_svws_core_data_kursblockung_KursblockungInputKursart } from '../../../core/data/kursblockung/KursblockungInputKursart';
- import { KursblockungInputFach, cast_de_nrw_schule_svws_core_data_kursblockung_KursblockungInputFach } from '../../../core/data/kursblockung/KursblockungInputFach';
- import { KursblockungInputFachwahl, cast_de_nrw_schule_svws_core_data_kursblockung_KursblockungInputFachwahl } from '../../../core/data/kursblockung/KursblockungInputFachwahl';
- import { Vector, cast_java_util_Vector } from '../../../java/util/Vector';
- export class KursblockungInput extends JavaObject {
- public enmRevision : number = -1;
- public input : number = 0;
- public maxTimeMillis : number = 0;
- public maxSchienen : number = 0;
- public regeln : Vector<KursblockungInputRegel> = new Vector();
- public faecher : Vector<KursblockungInputFach> = new Vector();
- public kursarten : Vector<KursblockungInputKursart> = new Vector();
- public kurse : Vector<KursblockungInputKurs> = new Vector();
- public schueler : Vector<KursblockungInputSchueler> = new Vector();
- public fachwahlen : Vector<KursblockungInputFachwahl> = new Vector();
- public constructor() {
- super();
- }
- isTranspiledInstanceOf(name : string): boolean {
- return ['de.nrw.schule.svws.core.data.kursblockung.KursblockungInput'].includes(name);
- }
- public static transpilerFromJSON(json : string): KursblockungInput {
- const obj = JSON.parse(json);
- const result = new KursblockungInput();
- if (typeof obj.enmRevision === "undefined")
- throw new Error('invalid json format, missing attribute enmRevision');
- result.enmRevision = obj.enmRevision;
- if (typeof obj.input === "undefined")
- throw new Error('invalid json format, missing attribute input');
- result.input = obj.input;
- if (typeof obj.maxTimeMillis === "undefined")
- throw new Error('invalid json format, missing attribute maxTimeMillis');
- result.maxTimeMillis = obj.maxTimeMillis;
- if (typeof obj.maxSchienen === "undefined")
- throw new Error('invalid json format, missing attribute maxSchienen');
- result.maxSchienen = obj.maxSchienen;
- if (!!obj.regeln) {
- for (let elem of obj.regeln) {
- result.regeln?.add(KursblockungInputRegel.transpilerFromJSON(JSON.stringify(elem)));
- }
- }
- if (!!obj.faecher) {
- for (let elem of obj.faecher) {
- result.faecher?.add(KursblockungInputFach.transpilerFromJSON(JSON.stringify(elem)));
- }
- }
- if (!!obj.kursarten) {
- for (let elem of obj.kursarten) {
- result.kursarten?.add(KursblockungInputKursart.transpilerFromJSON(JSON.stringify(elem)));
- }
- }
- if (!!obj.kurse) {
- for (let elem of obj.kurse) {
- result.kurse?.add(KursblockungInputKurs.transpilerFromJSON(JSON.stringify(elem)));
- }
- }
- if (!!obj.schueler) {
- for (let elem of obj.schueler) {
- result.schueler?.add(KursblockungInputSchueler.transpilerFromJSON(JSON.stringify(elem)));
- }
- }
- if (!!obj.fachwahlen) {
- for (let elem of obj.fachwahlen) {
- result.fachwahlen?.add(KursblockungInputFachwahl.transpilerFromJSON(JSON.stringify(elem)));
- }
- }
- return result;
- }
- public static transpilerToJSON(obj : KursblockungInput) : string {
- let result = '{';
- result += '"enmRevision" : ' + obj.enmRevision + ',';
- result += '"input" : ' + obj.input + ',';
- result += '"maxTimeMillis" : ' + obj.maxTimeMillis + ',';
- result += '"maxSchienen" : ' + obj.maxSchienen + ',';
- if (!obj.regeln) {
- result += '[]';
- } else {
- result += '[ ';
- for (let i : number = 0; i < obj.regeln.size(); i++) {
- let elem = obj.regeln.get(i);
- result += KursblockungInputRegel.transpilerToJSON(elem);
- if (i < obj.regeln.size() - 1)
- result += ',';
- }
- result += ' ]' + ',';
- }
- if (!obj.faecher) {
- result += '[]';
- } else {
- result += '[ ';
- for (let i : number = 0; i < obj.faecher.size(); i++) {
- let elem = obj.faecher.get(i);
- result += KursblockungInputFach.transpilerToJSON(elem);
- if (i < obj.faecher.size() - 1)
- result += ',';
- }
- result += ' ]' + ',';
- }
- if (!obj.kursarten) {
- result += '[]';
- } else {
- result += '[ ';
- for (let i : number = 0; i < obj.kursarten.size(); i++) {
- let elem = obj.kursarten.get(i);
- result += KursblockungInputKursart.transpilerToJSON(elem);
- if (i < obj.kursarten.size() - 1)
- result += ',';
- }
- result += ' ]' + ',';
- }
- if (!obj.kurse) {
- result += '[]';
- } else {
- result += '[ ';
- for (let i : number = 0; i < obj.kurse.size(); i++) {
- let elem = obj.kurse.get(i);
- result += KursblockungInputKurs.transpilerToJSON(elem);
- if (i < obj.kurse.size() - 1)
- result += ',';
- }
- result += ' ]' + ',';
- }
- if (!obj.schueler) {
- result += '[]';
- } else {
- result += '[ ';
- for (let i : number = 0; i < obj.schueler.size(); i++) {
- let elem = obj.schueler.get(i);
- result += KursblockungInputSchueler.transpilerToJSON(elem);
- if (i < obj.schueler.size() - 1)
- result += ',';
- }
- result += ' ]' + ',';
- }
- if (!obj.fachwahlen) {
- result += '[]';
- } else {
- result += '[ ';
- for (let i : number = 0; i < obj.fachwahlen.size(); i++) {
- let elem = obj.fachwahlen.get(i);
- result += KursblockungInputFachwahl.transpilerToJSON(elem);
- if (i < obj.fachwahlen.size() - 1)
- result += ',';
- }
- result += ' ]' + ',';
- }
- result = result.slice(0, -1);
- result += '}';
- return result;
- }
- public static transpilerToJSONPatch(obj : Partial<KursblockungInput>) : string {
- let result = '{';
- if (typeof obj.enmRevision !== "undefined") {
- result += '"enmRevision" : ' + obj.enmRevision + ',';
- }
- if (typeof obj.input !== "undefined") {
- result += '"input" : ' + obj.input + ',';
- }
- if (typeof obj.maxTimeMillis !== "undefined") {
- result += '"maxTimeMillis" : ' + obj.maxTimeMillis + ',';
- }
- if (typeof obj.maxSchienen !== "undefined") {
- result += '"maxSchienen" : ' + obj.maxSchienen + ',';
- }
- if (typeof obj.regeln !== "undefined") {
- if (!obj.regeln) {
- result += '[]';
- } else {
- result += '[ ';
- for (let i : number = 0; i < obj.regeln.size(); i++) {
- let elem = obj.regeln.get(i);
- result += KursblockungInputRegel.transpilerToJSON(elem);
- if (i < obj.regeln.size() - 1)
- result += ',';
- }
- result += ' ]' + ',';
- }
- }
- if (typeof obj.faecher !== "undefined") {
- if (!obj.faecher) {
- result += '[]';
- } else {
- result += '[ ';
- for (let i : number = 0; i < obj.faecher.size(); i++) {
- let elem = obj.faecher.get(i);
- result += KursblockungInputFach.transpilerToJSON(elem);
- if (i < obj.faecher.size() - 1)
- result += ',';
- }
- result += ' ]' + ',';
- }
- }
- if (typeof obj.kursarten !== "undefined") {
- if (!obj.kursarten) {
- result += '[]';
- } else {
- result += '[ ';
- for (let i : number = 0; i < obj.kursarten.size(); i++) {
- let elem = obj.kursarten.get(i);
- result += KursblockungInputKursart.transpilerToJSON(elem);
- if (i < obj.kursarten.size() - 1)
- result += ',';
- }
- result += ' ]' + ',';
- }
- }
- if (typeof obj.kurse !== "undefined") {
- if (!obj.kurse) {
- result += '[]';
- } else {
- result += '[ ';
- for (let i : number = 0; i < obj.kurse.size(); i++) {
- let elem = obj.kurse.get(i);
- result += KursblockungInputKurs.transpilerToJSON(elem);
- if (i < obj.kurse.size() - 1)
- result += ',';
- }
- result += ' ]' + ',';
- }
- }
- if (typeof obj.schueler !== "undefined") {
- if (!obj.schueler) {
- result += '[]';
- } else {
- result += '[ ';
- for (let i : number = 0; i < obj.schueler.size(); i++) {
- let elem = obj.schueler.get(i);
- result += KursblockungInputSchueler.transpilerToJSON(elem);
- if (i < obj.schueler.size() - 1)
- result += ',';
- }
- result += ' ]' + ',';
- }
- }
- if (typeof obj.fachwahlen !== "undefined") {
- if (!obj.fachwahlen) {
- result += '[]';
- } else {
- result += '[ ';
- for (let i : number = 0; i < obj.fachwahlen.size(); i++) {
- let elem = obj.fachwahlen.get(i);
- result += KursblockungInputFachwahl.transpilerToJSON(elem);
- if (i < obj.fachwahlen.size() - 1)
- result += ',';
- }
- result += ' ]' + ',';
- }
- }
- result = result.slice(0, -1);
- result += '}';
- return result;
- }
- }
- export function cast_de_nrw_schule_svws_core_data_kursblockung_KursblockungInput(obj : unknown) : KursblockungInput {
- return obj as KursblockungInput;
- }
|