For example:
public List<Integer> list = new ArrayList<>();
and how can I check through reflection that this list is empty and not null?
for (final Field field : ReflectionUtils.getDeclaredFields(clazz))
{
if (List.class.isAssignableFrom(field.getType()))
{
// TODO check whether the list is empty.
}
}
Aucun commentaire:
Enregistrer un commentaire