isEmpty
public static boolean isEmpty(String str)
comprueba si un String is empty ("") o null.
StringUtils.isEmpty(null) = true
StringUtils.isEmpty("") = true
StringUtils.isEmpty(" ") = false
StringUtils.isEmpty("texto") = false
StringUtils.isEmpty("texto") = false
isNotEmpty
public static boolean isNotEmpty(String str)
StringUtils.isNotEmpty(null) = false
StringUtils.isNotEmpty("") = false
StringUtils.isNotEmpty(" ") = true
StringUtils.isNotEmpty("texto") = true
StringUtils.isNotEmpty("texto") = true
.
You put:
if(!StringUtils.isEmpty(email){
This makes that if no esta vacio
enters the if, and applies what is inside, if I do not understand wrong, this is what you complain about, I think you could solve it using for example:
if(StringUtils.isEmpty(email){