GostFachwahl.ts 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 GostFachwahl extends JavaObject {
  4. public id : number = -1;
  5. public fachID : number = -1;
  6. public halbjahrID : number = -1;
  7. public schuelerID : number = -1;
  8. public schuelerNachname : String = "";
  9. public schuelerVorname : String = "";
  10. public kursartID : number = -1;
  11. public constructor() {
  12. super();
  13. }
  14. isTranspiledInstanceOf(name : string): boolean {
  15. return ['de.nrw.schule.svws.core.data.gost.GostFachwahl'].includes(name);
  16. }
  17. public static transpilerFromJSON(json : string): GostFachwahl {
  18. const obj = JSON.parse(json);
  19. const result = new GostFachwahl();
  20. if (typeof obj.id === "undefined")
  21. throw new Error('invalid json format, missing attribute id');
  22. result.id = obj.id;
  23. if (typeof obj.fachID === "undefined")
  24. throw new Error('invalid json format, missing attribute fachID');
  25. result.fachID = obj.fachID;
  26. if (typeof obj.halbjahrID === "undefined")
  27. throw new Error('invalid json format, missing attribute halbjahrID');
  28. result.halbjahrID = obj.halbjahrID;
  29. if (typeof obj.schuelerID === "undefined")
  30. throw new Error('invalid json format, missing attribute schuelerID');
  31. result.schuelerID = obj.schuelerID;
  32. if (typeof obj.schuelerNachname === "undefined")
  33. throw new Error('invalid json format, missing attribute schuelerNachname');
  34. result.schuelerNachname = obj.schuelerNachname;
  35. if (typeof obj.schuelerVorname === "undefined")
  36. throw new Error('invalid json format, missing attribute schuelerVorname');
  37. result.schuelerVorname = obj.schuelerVorname;
  38. if (typeof obj.kursartID === "undefined")
  39. throw new Error('invalid json format, missing attribute kursartID');
  40. result.kursartID = obj.kursartID;
  41. return result;
  42. }
  43. public static transpilerToJSON(obj : GostFachwahl) : string {
  44. let result = '{';
  45. result += '"id" : ' + obj.id + ',';
  46. result += '"fachID" : ' + obj.fachID + ',';
  47. result += '"halbjahrID" : ' + obj.halbjahrID + ',';
  48. result += '"schuelerID" : ' + obj.schuelerID + ',';
  49. result += '"schuelerNachname" : ' + '"' + obj.schuelerNachname.valueOf() + '"' + ',';
  50. result += '"schuelerVorname" : ' + '"' + obj.schuelerVorname.valueOf() + '"' + ',';
  51. result += '"kursartID" : ' + obj.kursartID + ',';
  52. result = result.slice(0, -1);
  53. result += '}';
  54. return result;
  55. }
  56. public static transpilerToJSONPatch(obj : Partial<GostFachwahl>) : string {
  57. let result = '{';
  58. if (typeof obj.id !== "undefined") {
  59. result += '"id" : ' + obj.id + ',';
  60. }
  61. if (typeof obj.fachID !== "undefined") {
  62. result += '"fachID" : ' + obj.fachID + ',';
  63. }
  64. if (typeof obj.halbjahrID !== "undefined") {
  65. result += '"halbjahrID" : ' + obj.halbjahrID + ',';
  66. }
  67. if (typeof obj.schuelerID !== "undefined") {
  68. result += '"schuelerID" : ' + obj.schuelerID + ',';
  69. }
  70. if (typeof obj.schuelerNachname !== "undefined") {
  71. result += '"schuelerNachname" : ' + '"' + obj.schuelerNachname.valueOf() + '"' + ',';
  72. }
  73. if (typeof obj.schuelerVorname !== "undefined") {
  74. result += '"schuelerVorname" : ' + '"' + obj.schuelerVorname.valueOf() + '"' + ',';
  75. }
  76. if (typeof obj.kursartID !== "undefined") {
  77. result += '"kursartID" : ' + obj.kursartID + ',';
  78. }
  79. result = result.slice(0, -1);
  80. result += '}';
  81. return result;
  82. }
  83. }
  84. export function cast_de_nrw_schule_svws_core_data_gost_GostFachwahl(obj : unknown) : GostFachwahl {
  85. return obj as GostFachwahl;
  86. }