KursblockungInputSchueler.ts 2.1 KB

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