GostBlockungKurs.js 3.7 KB

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