KursblockungInputKurs.ts 3.0 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 KursblockungInputKurs extends JavaObject {
  4. public enmRevision : number = -1;
  5. public id : number = 0;
  6. public fach : number = 0;
  7. public kursart : number = 0;
  8. public schienen : 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.KursblockungInputKurs'].includes(name);
  15. }
  16. public static transpilerFromJSON(json : string): KursblockungInputKurs {
  17. const obj = JSON.parse(json);
  18. const result = new KursblockungInputKurs();
  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.fach === "undefined")
  26. throw new Error('invalid json format, missing attribute fach');
  27. result.fach = obj.fach;
  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.schienen === "undefined")
  32. throw new Error('invalid json format, missing attribute schienen');
  33. result.schienen = obj.schienen;
  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 : KursblockungInputKurs) : string {
  40. let result = '{';
  41. result += '"enmRevision" : ' + obj.enmRevision + ',';
  42. result += '"id" : ' + obj.id + ',';
  43. result += '"fach" : ' + obj.fach + ',';
  44. result += '"kursart" : ' + obj.kursart + ',';
  45. result += '"schienen" : ' + obj.schienen + ',';
  46. result += '"representation" : ' + '"' + obj.representation.valueOf() + '"' + ',';
  47. result = result.slice(0, -1);
  48. result += '}';
  49. return result;
  50. }
  51. public static transpilerToJSONPatch(obj : Partial<KursblockungInputKurs>) : 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.fach !== "undefined") {
  60. result += '"fach" : ' + obj.fach + ',';
  61. }
  62. if (typeof obj.kursart !== "undefined") {
  63. result += '"kursart" : ' + obj.kursart + ',';
  64. }
  65. if (typeof obj.schienen !== "undefined") {
  66. result += '"schienen" : ' + obj.schienen + ',';
  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_KursblockungInputKurs(obj : unknown) : KursblockungInputKurs {
  77. return obj as KursblockungInputKurs;
  78. }