KursblockungInput.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.cast_de_nrw_schule_svws_core_data_kursblockung_KursblockungInput = exports.KursblockungInput = void 0;
  4. const JavaObject_1 = require("../../../java/lang/JavaObject");
  5. const KursblockungInputKurs_1 = require("../../../core/data/kursblockung/KursblockungInputKurs");
  6. const KursblockungInputSchueler_1 = require("../../../core/data/kursblockung/KursblockungInputSchueler");
  7. const KursblockungInputRegel_1 = require("../../../core/data/kursblockung/KursblockungInputRegel");
  8. const KursblockungInputKursart_1 = require("../../../core/data/kursblockung/KursblockungInputKursart");
  9. const KursblockungInputFach_1 = require("../../../core/data/kursblockung/KursblockungInputFach");
  10. const KursblockungInputFachwahl_1 = require("../../../core/data/kursblockung/KursblockungInputFachwahl");
  11. const Vector_1 = require("../../../java/util/Vector");
  12. class KursblockungInput extends JavaObject_1.JavaObject {
  13. enmRevision = -1;
  14. input = 0;
  15. maxTimeMillis = 0;
  16. maxSchienen = 0;
  17. regeln = new Vector_1.Vector();
  18. faecher = new Vector_1.Vector();
  19. kursarten = new Vector_1.Vector();
  20. kurse = new Vector_1.Vector();
  21. schueler = new Vector_1.Vector();
  22. fachwahlen = new Vector_1.Vector();
  23. constructor() {
  24. super();
  25. }
  26. isTranspiledInstanceOf(name) {
  27. return ['de.nrw.schule.svws.core.data.kursblockung.KursblockungInput'].includes(name);
  28. }
  29. static transpilerFromJSON(json) {
  30. const obj = JSON.parse(json);
  31. const result = new KursblockungInput();
  32. if (typeof obj.enmRevision === "undefined")
  33. throw new Error('invalid json format, missing attribute enmRevision');
  34. result.enmRevision = obj.enmRevision;
  35. if (typeof obj.input === "undefined")
  36. throw new Error('invalid json format, missing attribute input');
  37. result.input = obj.input;
  38. if (typeof obj.maxTimeMillis === "undefined")
  39. throw new Error('invalid json format, missing attribute maxTimeMillis');
  40. result.maxTimeMillis = obj.maxTimeMillis;
  41. if (typeof obj.maxSchienen === "undefined")
  42. throw new Error('invalid json format, missing attribute maxSchienen');
  43. result.maxSchienen = obj.maxSchienen;
  44. if (!!obj.regeln) {
  45. for (let elem of obj.regeln) {
  46. result.regeln?.add(KursblockungInputRegel_1.KursblockungInputRegel.transpilerFromJSON(JSON.stringify(elem)));
  47. }
  48. }
  49. if (!!obj.faecher) {
  50. for (let elem of obj.faecher) {
  51. result.faecher?.add(KursblockungInputFach_1.KursblockungInputFach.transpilerFromJSON(JSON.stringify(elem)));
  52. }
  53. }
  54. if (!!obj.kursarten) {
  55. for (let elem of obj.kursarten) {
  56. result.kursarten?.add(KursblockungInputKursart_1.KursblockungInputKursart.transpilerFromJSON(JSON.stringify(elem)));
  57. }
  58. }
  59. if (!!obj.kurse) {
  60. for (let elem of obj.kurse) {
  61. result.kurse?.add(KursblockungInputKurs_1.KursblockungInputKurs.transpilerFromJSON(JSON.stringify(elem)));
  62. }
  63. }
  64. if (!!obj.schueler) {
  65. for (let elem of obj.schueler) {
  66. result.schueler?.add(KursblockungInputSchueler_1.KursblockungInputSchueler.transpilerFromJSON(JSON.stringify(elem)));
  67. }
  68. }
  69. if (!!obj.fachwahlen) {
  70. for (let elem of obj.fachwahlen) {
  71. result.fachwahlen?.add(KursblockungInputFachwahl_1.KursblockungInputFachwahl.transpilerFromJSON(JSON.stringify(elem)));
  72. }
  73. }
  74. return result;
  75. }
  76. static transpilerToJSON(obj) {
  77. let result = '{';
  78. result += '"enmRevision" : ' + obj.enmRevision + ',';
  79. result += '"input" : ' + obj.input + ',';
  80. result += '"maxTimeMillis" : ' + obj.maxTimeMillis + ',';
  81. result += '"maxSchienen" : ' + obj.maxSchienen + ',';
  82. if (!obj.regeln) {
  83. result += '[]';
  84. }
  85. else {
  86. result += '[ ';
  87. for (let i = 0; i < obj.regeln.size(); i++) {
  88. let elem = obj.regeln.get(i);
  89. result += KursblockungInputRegel_1.KursblockungInputRegel.transpilerToJSON(elem);
  90. if (i < obj.regeln.size() - 1)
  91. result += ',';
  92. }
  93. result += ' ]' + ',';
  94. }
  95. if (!obj.faecher) {
  96. result += '[]';
  97. }
  98. else {
  99. result += '[ ';
  100. for (let i = 0; i < obj.faecher.size(); i++) {
  101. let elem = obj.faecher.get(i);
  102. result += KursblockungInputFach_1.KursblockungInputFach.transpilerToJSON(elem);
  103. if (i < obj.faecher.size() - 1)
  104. result += ',';
  105. }
  106. result += ' ]' + ',';
  107. }
  108. if (!obj.kursarten) {
  109. result += '[]';
  110. }
  111. else {
  112. result += '[ ';
  113. for (let i = 0; i < obj.kursarten.size(); i++) {
  114. let elem = obj.kursarten.get(i);
  115. result += KursblockungInputKursart_1.KursblockungInputKursart.transpilerToJSON(elem);
  116. if (i < obj.kursarten.size() - 1)
  117. result += ',';
  118. }
  119. result += ' ]' + ',';
  120. }
  121. if (!obj.kurse) {
  122. result += '[]';
  123. }
  124. else {
  125. result += '[ ';
  126. for (let i = 0; i < obj.kurse.size(); i++) {
  127. let elem = obj.kurse.get(i);
  128. result += KursblockungInputKurs_1.KursblockungInputKurs.transpilerToJSON(elem);
  129. if (i < obj.kurse.size() - 1)
  130. result += ',';
  131. }
  132. result += ' ]' + ',';
  133. }
  134. if (!obj.schueler) {
  135. result += '[]';
  136. }
  137. else {
  138. result += '[ ';
  139. for (let i = 0; i < obj.schueler.size(); i++) {
  140. let elem = obj.schueler.get(i);
  141. result += KursblockungInputSchueler_1.KursblockungInputSchueler.transpilerToJSON(elem);
  142. if (i < obj.schueler.size() - 1)
  143. result += ',';
  144. }
  145. result += ' ]' + ',';
  146. }
  147. if (!obj.fachwahlen) {
  148. result += '[]';
  149. }
  150. else {
  151. result += '[ ';
  152. for (let i = 0; i < obj.fachwahlen.size(); i++) {
  153. let elem = obj.fachwahlen.get(i);
  154. result += KursblockungInputFachwahl_1.KursblockungInputFachwahl.transpilerToJSON(elem);
  155. if (i < obj.fachwahlen.size() - 1)
  156. result += ',';
  157. }
  158. result += ' ]' + ',';
  159. }
  160. result = result.slice(0, -1);
  161. result += '}';
  162. return result;
  163. }
  164. static transpilerToJSONPatch(obj) {
  165. let result = '{';
  166. if (typeof obj.enmRevision !== "undefined") {
  167. result += '"enmRevision" : ' + obj.enmRevision + ',';
  168. }
  169. if (typeof obj.input !== "undefined") {
  170. result += '"input" : ' + obj.input + ',';
  171. }
  172. if (typeof obj.maxTimeMillis !== "undefined") {
  173. result += '"maxTimeMillis" : ' + obj.maxTimeMillis + ',';
  174. }
  175. if (typeof obj.maxSchienen !== "undefined") {
  176. result += '"maxSchienen" : ' + obj.maxSchienen + ',';
  177. }
  178. if (typeof obj.regeln !== "undefined") {
  179. if (!obj.regeln) {
  180. result += '[]';
  181. }
  182. else {
  183. result += '[ ';
  184. for (let i = 0; i < obj.regeln.size(); i++) {
  185. let elem = obj.regeln.get(i);
  186. result += KursblockungInputRegel_1.KursblockungInputRegel.transpilerToJSON(elem);
  187. if (i < obj.regeln.size() - 1)
  188. result += ',';
  189. }
  190. result += ' ]' + ',';
  191. }
  192. }
  193. if (typeof obj.faecher !== "undefined") {
  194. if (!obj.faecher) {
  195. result += '[]';
  196. }
  197. else {
  198. result += '[ ';
  199. for (let i = 0; i < obj.faecher.size(); i++) {
  200. let elem = obj.faecher.get(i);
  201. result += KursblockungInputFach_1.KursblockungInputFach.transpilerToJSON(elem);
  202. if (i < obj.faecher.size() - 1)
  203. result += ',';
  204. }
  205. result += ' ]' + ',';
  206. }
  207. }
  208. if (typeof obj.kursarten !== "undefined") {
  209. if (!obj.kursarten) {
  210. result += '[]';
  211. }
  212. else {
  213. result += '[ ';
  214. for (let i = 0; i < obj.kursarten.size(); i++) {
  215. let elem = obj.kursarten.get(i);
  216. result += KursblockungInputKursart_1.KursblockungInputKursart.transpilerToJSON(elem);
  217. if (i < obj.kursarten.size() - 1)
  218. result += ',';
  219. }
  220. result += ' ]' + ',';
  221. }
  222. }
  223. if (typeof obj.kurse !== "undefined") {
  224. if (!obj.kurse) {
  225. result += '[]';
  226. }
  227. else {
  228. result += '[ ';
  229. for (let i = 0; i < obj.kurse.size(); i++) {
  230. let elem = obj.kurse.get(i);
  231. result += KursblockungInputKurs_1.KursblockungInputKurs.transpilerToJSON(elem);
  232. if (i < obj.kurse.size() - 1)
  233. result += ',';
  234. }
  235. result += ' ]' + ',';
  236. }
  237. }
  238. if (typeof obj.schueler !== "undefined") {
  239. if (!obj.schueler) {
  240. result += '[]';
  241. }
  242. else {
  243. result += '[ ';
  244. for (let i = 0; i < obj.schueler.size(); i++) {
  245. let elem = obj.schueler.get(i);
  246. result += KursblockungInputSchueler_1.KursblockungInputSchueler.transpilerToJSON(elem);
  247. if (i < obj.schueler.size() - 1)
  248. result += ',';
  249. }
  250. result += ' ]' + ',';
  251. }
  252. }
  253. if (typeof obj.fachwahlen !== "undefined") {
  254. if (!obj.fachwahlen) {
  255. result += '[]';
  256. }
  257. else {
  258. result += '[ ';
  259. for (let i = 0; i < obj.fachwahlen.size(); i++) {
  260. let elem = obj.fachwahlen.get(i);
  261. result += KursblockungInputFachwahl_1.KursblockungInputFachwahl.transpilerToJSON(elem);
  262. if (i < obj.fachwahlen.size() - 1)
  263. result += ',';
  264. }
  265. result += ' ]' + ',';
  266. }
  267. }
  268. result = result.slice(0, -1);
  269. result += '}';
  270. return result;
  271. }
  272. }
  273. exports.KursblockungInput = KursblockungInput;
  274. function cast_de_nrw_schule_svws_core_data_kursblockung_KursblockungInput(obj) {
  275. return obj;
  276. }
  277. exports.cast_de_nrw_schule_svws_core_data_kursblockung_KursblockungInput = cast_de_nrw_schule_svws_core_data_kursblockung_KursblockungInput;
  278. //# sourceMappingURL=KursblockungInput.js.map