KursblockungInputFachwahl.ts 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import { JavaObject, cast_java_lang_Object } from '../../../java/lang/JavaObject';
  2. import { JavaString, cast_java_lang_String } from '../../../java/lang/JavaString';
  3. export class KursblockungInputFachwahl extends JavaObject {
  4. public enmRevision : number = -1;
  5. public id : number = 0;
  6. public schueler : number = 0;
  7. public fach : number = 0;
  8. public kursart : number = 0;
  9. public representation : String = "";
  10. public constructor() {
  11. super();
  12. }
  13. isTranspiledInstanceOf(name : string): boolean {
  14. return ['de.nrw.schule.svws.core.data.kursblockung.KursblockungInputFachwahl'].includes(name);
  15. }
  16. public static transpilerFromJSON(json : string): KursblockungInputFachwahl {
  17. const obj = JSON.parse(json);
  18. const result = new KursblockungInputFachwahl();
  19. if (typeof obj.enmRevision === "undefined")
  20. throw new Error('invalid json format, missing attribute enmRevision');
  21. result.enmRevision = obj.enmRevision;
  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.schueler === "undefined")
  26. throw new Error('invalid json format, missing attribute schueler');
  27. result.schueler = obj.schueler;
  28. if (typeof obj.fach === "undefined")
  29. throw new Error('invalid json format, missing attribute fach');
  30. result.fach = obj.fach;
  31. if (typeof obj.kursart === "undefined")
  32. throw new Error('invalid json format, missing attribute kursart');
  33. result.kursart = obj.kursart;
  34. if (typeof obj.representation === "undefined")
  35. throw new Error('invalid json format, missing attribute representation');
  36. result.representation = obj.representation;
  37. return result;
  38. }
  39. public static transpilerToJSON(obj : KursblockungInputFachwahl) : string {
  40. let result = '{';
  41. result += '"enmRevision" : ' + obj.enmRevision + ',';
  42. result += '"id" : ' + obj.id + ',';
  43. result += '"schueler" : ' + obj.schueler + ',';
  44. result += '"fach" : ' + obj.fach + ',';
  45. result += '"kursart" : ' + obj.kursart + ',';
  46. result += '"representation" : ' + '"' + obj.representation.valueOf() + '"' + ',';
  47. result = result.slice(0, -1);
  48. result += '}';
  49. return result;
  50. }
  51. public static transpilerToJSONPatch(obj : Partial<KursblockungInputFachwahl>) : string {
  52. let result = '{';
  53. if (typeof obj.enmRevision !== "undefined") {
  54. result += '"enmRevision" : ' + obj.enmRevision + ',';
  55. }
  56. if (typeof obj.id !== "undefined") {
  57. result += '"id" : ' + obj.id + ',';
  58. }
  59. if (typeof obj.schueler !== "undefined") {
  60. result += '"schueler" : ' + obj.schueler + ',';
  61. }
  62. if (typeof obj.fach !== "undefined") {
  63. result += '"fach" : ' + obj.fach + ',';
  64. }
  65. if (typeof obj.kursart !== "undefined") {
  66. result += '"kursart" : ' + obj.kursart + ',';
  67. }
  68. if (typeof obj.representation !== "undefined") {
  69. result += '"representation" : ' + '"' + obj.representation.valueOf() + '"' + ',';
  70. }
  71. result = result.slice(0, -1);
  72. result += '}';
  73. return result;
  74. }
  75. }
  76. export function cast_de_nrw_schule_svws_core_data_kursblockung_KursblockungInputFachwahl(obj : unknown) : KursblockungInputFachwahl {
  77. return obj as KursblockungInputFachwahl;
  78. }