mercredi 25 septembre 2019

Getting the fields with reflection

How it is possible:

myobject.getClass().getDeclaredFields();
for (Field f : fields) {
    LOGGER.debug(f);
}

DEBUG id
DEBUG name
DEBUG type

and when I try to get type field

myobject.getClass().getDeclaredFields("type");

then I get

NoSuchElementException: type





Aucun commentaire:

Enregistrer un commentaire