Under Java Spring boot, I have some returned object (of type Object
) from a function having the following structure :
{id=5, name=Jasmin, description=Room Jasmin, idType=0, addedAt=2020-06-16T17:20:00.617+0000, modifiedAt=null, deleted=true, images=[string],
idBuilding=2, idFloor=4, idZone=3}
How to get the value of the id ? I tried converting it to JSONObject but it's not working, also i tried the reflection approach :
Class<?> clazz = x.getClass();
Field field = clazz.getField("fieldName");
Object fieldValue = field.get(x);
But it's not working either returns null.
Thank you.