import { JavaObject, cast_java_lang_Object } from '../../../java/lang/JavaObject';
import { JavaString, cast_java_lang_String } from '../../../java/lang/JavaString';

export class NationalitaetKatalogEintrag extends JavaObject {

	public id : String | null = null;

	public land : String | null = null;

	public staatsangehoerigkeit : String | null = null;


	public constructor() {
		super();
	}

	isTranspiledInstanceOf(name : string): boolean {
		return ['de.nrw.schule.svws.core.data.kataloge.NationalitaetKatalogEintrag'].includes(name);
	}

	public static transpilerFromJSON(json : string): NationalitaetKatalogEintrag {
		const obj = JSON.parse(json);
		const result = new NationalitaetKatalogEintrag();
		result.id = typeof obj.id === "undefined" ? null : obj.id;
		result.land = typeof obj.land === "undefined" ? null : obj.land;
		result.staatsangehoerigkeit = typeof obj.staatsangehoerigkeit === "undefined" ? null : obj.staatsangehoerigkeit;
		return result;
	}

	public static transpilerToJSON(obj : NationalitaetKatalogEintrag) : string {
		let result = '{';
		result += '"id" : ' + ((!obj.id) ? 'null' : '"' + obj.id.valueOf() + '"') + ',';
		result += '"land" : ' + ((!obj.land) ? 'null' : '"' + obj.land.valueOf() + '"') + ',';
		result += '"staatsangehoerigkeit" : ' + ((!obj.staatsangehoerigkeit) ? 'null' : '"' + obj.staatsangehoerigkeit.valueOf() + '"') + ',';
		result = result.slice(0, -1);
		result += '}';
		return result;
	}

	public static transpilerToJSONPatch(obj : Partial<NationalitaetKatalogEintrag>) : string {
		let result = '{';
		if (typeof obj.id !== "undefined") {
			result += '"id" : ' + ((!obj.id) ? 'null' : '"' + obj.id.valueOf() + '"') + ',';
		}
		if (typeof obj.land !== "undefined") {
			result += '"land" : ' + ((!obj.land) ? 'null' : '"' + obj.land.valueOf() + '"') + ',';
		}
		if (typeof obj.staatsangehoerigkeit !== "undefined") {
			result += '"staatsangehoerigkeit" : ' + ((!obj.staatsangehoerigkeit) ? 'null' : '"' + obj.staatsangehoerigkeit.valueOf() + '"') + ',';
		}
		result = result.slice(0, -1);
		result += '}';
		return result;
	}

}

export function cast_de_nrw_schule_svws_core_data_kataloge_NationalitaetKatalogEintrag(obj : unknown) : NationalitaetKatalogEintrag {
	return obj as NationalitaetKatalogEintrag;
}
