ENMLehrer.ts 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 ENMLehrer extends JavaObject {
  4. public id : number = 0;
  5. public kuerzel : String | null = null;
  6. public nachname : String | null = null;
  7. public vorname : String | null = null;
  8. public eMailDienstlich : String | null = null;
  9. public constructor() {
  10. super();
  11. }
  12. isTranspiledInstanceOf(name : string): boolean {
  13. return ['de.nrw.schule.svws.core.data.enm.ENMLehrer'].includes(name);
  14. }
  15. public static transpilerFromJSON(json : string): ENMLehrer {
  16. const obj = JSON.parse(json);
  17. const result = new ENMLehrer();
  18. if (typeof obj.id === "undefined")
  19. throw new Error('invalid json format, missing attribute id');
  20. result.id = obj.id;
  21. result.kuerzel = typeof obj.kuerzel === "undefined" ? null : obj.kuerzel;
  22. result.nachname = typeof obj.nachname === "undefined" ? null : obj.nachname;
  23. result.vorname = typeof obj.vorname === "undefined" ? null : obj.vorname;
  24. result.eMailDienstlich = typeof obj.eMailDienstlich === "undefined" ? null : obj.eMailDienstlich;
  25. return result;
  26. }
  27. public static transpilerToJSON(obj : ENMLehrer) : string {
  28. let result = '{';
  29. result += '"id" : ' + obj.id + ',';
  30. result += '"kuerzel" : ' + ((!obj.kuerzel) ? 'null' : '"' + obj.kuerzel.valueOf() + '"') + ',';
  31. result += '"nachname" : ' + ((!obj.nachname) ? 'null' : '"' + obj.nachname.valueOf() + '"') + ',';
  32. result += '"vorname" : ' + ((!obj.vorname) ? 'null' : '"' + obj.vorname.valueOf() + '"') + ',';
  33. result += '"eMailDienstlich" : ' + ((!obj.eMailDienstlich) ? 'null' : '"' + obj.eMailDienstlich.valueOf() + '"') + ',';
  34. result = result.slice(0, -1);
  35. result += '}';
  36. return result;
  37. }
  38. public static transpilerToJSONPatch(obj : Partial<ENMLehrer>) : string {
  39. let result = '{';
  40. if (typeof obj.id !== "undefined") {
  41. result += '"id" : ' + obj.id + ',';
  42. }
  43. if (typeof obj.kuerzel !== "undefined") {
  44. result += '"kuerzel" : ' + ((!obj.kuerzel) ? 'null' : '"' + obj.kuerzel.valueOf() + '"') + ',';
  45. }
  46. if (typeof obj.nachname !== "undefined") {
  47. result += '"nachname" : ' + ((!obj.nachname) ? 'null' : '"' + obj.nachname.valueOf() + '"') + ',';
  48. }
  49. if (typeof obj.vorname !== "undefined") {
  50. result += '"vorname" : ' + ((!obj.vorname) ? 'null' : '"' + obj.vorname.valueOf() + '"') + ',';
  51. }
  52. if (typeof obj.eMailDienstlich !== "undefined") {
  53. result += '"eMailDienstlich" : ' + ((!obj.eMailDienstlich) ? 'null' : '"' + obj.eMailDienstlich.valueOf() + '"') + ',';
  54. }
  55. result = result.slice(0, -1);
  56. result += '}';
  57. return result;
  58. }
  59. }
  60. export function cast_de_nrw_schule_svws_core_data_enm_ENMLehrer(obj : unknown) : ENMLehrer {
  61. return obj as ENMLehrer;
  62. }