ENMNote.ts 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import { JavaObject, cast_java_lang_Object } from '../../../java/lang/JavaObject';
  2. import { JavaInteger, cast_java_lang_Integer } from '../../../java/lang/JavaInteger';
  3. import { JavaString, cast_java_lang_String } from '../../../java/lang/JavaString';
  4. export class ENMNote extends JavaObject {
  5. public kuerzel : String | null = null;
  6. public notenpunkte : Number | null = null;
  7. public text : String | null = null;
  8. public constructor() {
  9. super();
  10. }
  11. isTranspiledInstanceOf(name : string): boolean {
  12. return ['de.nrw.schule.svws.core.data.enm.ENMNote'].includes(name);
  13. }
  14. public static transpilerFromJSON(json : string): ENMNote {
  15. const obj = JSON.parse(json);
  16. const result = new ENMNote();
  17. result.kuerzel = typeof obj.kuerzel === "undefined" ? null : obj.kuerzel;
  18. result.notenpunkte = typeof obj.notenpunkte === "undefined" ? null : obj.notenpunkte;
  19. result.text = typeof obj.text === "undefined" ? null : obj.text;
  20. return result;
  21. }
  22. public static transpilerToJSON(obj : ENMNote) : string {
  23. let result = '{';
  24. result += '"kuerzel" : ' + ((!obj.kuerzel) ? 'null' : '"' + obj.kuerzel.valueOf() + '"') + ',';
  25. result += '"notenpunkte" : ' + ((!obj.notenpunkte) ? 'null' : obj.notenpunkte.valueOf()) + ',';
  26. result += '"text" : ' + ((!obj.text) ? 'null' : '"' + obj.text.valueOf() + '"') + ',';
  27. result = result.slice(0, -1);
  28. result += '}';
  29. return result;
  30. }
  31. public static transpilerToJSONPatch(obj : Partial<ENMNote>) : string {
  32. let result = '{';
  33. if (typeof obj.kuerzel !== "undefined") {
  34. result += '"kuerzel" : ' + ((!obj.kuerzel) ? 'null' : '"' + obj.kuerzel.valueOf() + '"') + ',';
  35. }
  36. if (typeof obj.notenpunkte !== "undefined") {
  37. result += '"notenpunkte" : ' + ((!obj.notenpunkte) ? 'null' : obj.notenpunkte.valueOf()) + ',';
  38. }
  39. if (typeof obj.text !== "undefined") {
  40. result += '"text" : ' + ((!obj.text) ? 'null' : '"' + obj.text.valueOf() + '"') + ',';
  41. }
  42. result = result.slice(0, -1);
  43. result += '}';
  44. return result;
  45. }
  46. }
  47. export function cast_de_nrw_schule_svws_core_data_enm_ENMNote(obj : unknown) : ENMNote {
  48. return obj as ENMNote;
  49. }