Created
November 21, 2014 20:12
-
-
Save rafarocha/553ae7109479bfb2274d to your computer and use it in GitHub Desktop.
Removendo string nula ou vazia com FluentIterable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static Iterable<String> filter(Iterable<String> strings) { | |
if ( Iterables.isEmpty(strings) ) return null; | |
return FluentIterable | |
.from( strings ) | |
.filter( new Predicate<String>() { | |
@Override public boolean apply(String value) { | |
return !isEmpty( strip(value) ); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment