KursblockungOutputs.js 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.cast_de_nrw_schule_svws_core_data_kursblockung_KursblockungOutputs = exports.KursblockungOutputs = void 0;
  4. const JavaObject_1 = require("../../../java/lang/JavaObject");
  5. const KursblockungOutput_1 = require("../../../core/data/kursblockung/KursblockungOutput");
  6. const Vector_1 = require("../../../java/util/Vector");
  7. class KursblockungOutputs extends JavaObject_1.JavaObject {
  8. blockungsRevision = -1;
  9. outputs = new Vector_1.Vector();
  10. constructor() {
  11. super();
  12. }
  13. isTranspiledInstanceOf(name) {
  14. return ['de.nrw.schule.svws.core.data.kursblockung.KursblockungOutputs'].includes(name);
  15. }
  16. static transpilerFromJSON(json) {
  17. const obj = JSON.parse(json);
  18. const result = new KursblockungOutputs();
  19. if (typeof obj.blockungsRevision === "undefined")
  20. throw new Error('invalid json format, missing attribute blockungsRevision');
  21. result.blockungsRevision = obj.blockungsRevision;
  22. if (!!obj.outputs) {
  23. for (let elem of obj.outputs) {
  24. result.outputs?.add(KursblockungOutput_1.KursblockungOutput.transpilerFromJSON(JSON.stringify(elem)));
  25. }
  26. }
  27. return result;
  28. }
  29. static transpilerToJSON(obj) {
  30. let result = '{';
  31. result += '"blockungsRevision" : ' + obj.blockungsRevision + ',';
  32. if (!obj.outputs) {
  33. result += '[]';
  34. }
  35. else {
  36. result += '[ ';
  37. for (let i = 0; i < obj.outputs.size(); i++) {
  38. let elem = obj.outputs.get(i);
  39. result += KursblockungOutput_1.KursblockungOutput.transpilerToJSON(elem);
  40. if (i < obj.outputs.size() - 1)
  41. result += ',';
  42. }
  43. result += ' ]' + ',';
  44. }
  45. result = result.slice(0, -1);
  46. result += '}';
  47. return result;
  48. }
  49. static transpilerToJSONPatch(obj) {
  50. let result = '{';
  51. if (typeof obj.blockungsRevision !== "undefined") {
  52. result += '"blockungsRevision" : ' + obj.blockungsRevision + ',';
  53. }
  54. if (typeof obj.outputs !== "undefined") {
  55. if (!obj.outputs) {
  56. result += '[]';
  57. }
  58. else {
  59. result += '[ ';
  60. for (let i = 0; i < obj.outputs.size(); i++) {
  61. let elem = obj.outputs.get(i);
  62. result += KursblockungOutput_1.KursblockungOutput.transpilerToJSON(elem);
  63. if (i < obj.outputs.size() - 1)
  64. result += ',';
  65. }
  66. result += ' ]' + ',';
  67. }
  68. }
  69. result = result.slice(0, -1);
  70. result += '}';
  71. return result;
  72. }
  73. }
  74. exports.KursblockungOutputs = KursblockungOutputs;
  75. function cast_de_nrw_schule_svws_core_data_kursblockung_KursblockungOutputs(obj) {
  76. return obj;
  77. }
  78. exports.cast_de_nrw_schule_svws_core_data_kursblockung_KursblockungOutputs = cast_de_nrw_schule_svws_core_data_kursblockung_KursblockungOutputs;
  79. //# sourceMappingURL=KursblockungOutputs.js.map