GostBeratungslehrer.ts 2.4 KB

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