GostBlockungRegel.js 2.9 KB

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