Skip to content

Instantly share code, notes, and snippets.

@IsaacGonzalez
Created April 23, 2013 19:55
Show Gist options
  • Save IsaacGonzalez/5446872 to your computer and use it in GitHub Desktop.
Save IsaacGonzalez/5446872 to your computer and use it in GitHub Desktop.
Utilizando reflection en JAVA para verificar que ninguno de los atributos de un objeto sea null
for(Field f: constanciaSimple.getClass().getFields()){
f.setAccesible(true);
try{
assertNotNull(f.get(constanciaSimple));
} catch (IllegalArgumentException e){
e.printStackTrace();
} catch (IllegalArgumentException e){
e.printStackTrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment