Skip to content

Commit 6b35d99

Browse files
committed
Add isNotNullOrEmpty to Strings.
1 parent 298c05f commit 6b35d99

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

core/src/main/java/fj/function/Strings.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ private Strings() {
1414
throw new UnsupportedOperationException();
1515
}
1616

17+
/**
18+
* This function checks if a given String is neither <code>null</code> nor empty.
19+
*/
20+
public static final F<String, Boolean> isNotNullOrEmpty = new F<String, Boolean>() {
21+
@Override
22+
public Boolean f(final String a) {
23+
return a != null && a.length() > 0;
24+
}
25+
};
26+
1727
/**
1828
* A curried version of {@link String#isEmpty()}.
1929
*/

0 commit comments

Comments
 (0)