KursblockungInputRegel.js 3.0 KB

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