You can use StringUtils.isNotBlank from apache commons OR StringUtils.hasText from Spring