MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / isNotBlank

Method isNotBlank

src/main/java/org/htmlunit/util/StringUtils.java:131–147  ·  view source on GitHub ↗

Tests if a CharSequence is NOT null, empty, or contains only whitespace. @param s the CharSequence to check @return false if a CharSequence is null, empty, or contains only whitespace

(final CharSequence s)

Source from the content-addressed store, hash-verified

129 * @return false if a CharSequence is null, empty, or contains only whitespace
130 */
131 public static boolean isNotBlank(final CharSequence s) {
132 if (s == null) {
133 return false;
134 }
135
136 final int length = s.length();
137 if (length == 0) {
138 return false;
139 }
140
141 for (int i = 0; i < length; i++) {
142 if (!Character.isWhitespace(s.charAt(i))) {
143 return true;
144 }
145 }
146 return false;
147 }
148
149 /**
150 * @param expected the char that we expect

Callers 15

doServiceMethod · 0.95
logMethod · 0.95
testMethod · 0.95
contentTypeHeaderMethod · 0.95
isNotBlankMethod · 0.95
loadWebResponseIntoMethod · 0.95
buildNewStateUrlMethod · 0.95
readAsTextMethod · 0.95
fillRequestMethod · 0.95
isValidMethod · 0.95
findReferencingImageMethod · 0.95
writeStyleToElementMethod · 0.95

Calls 2

isWhitespaceMethod · 0.80
lengthMethod · 0.65

Tested by 5

doServiceMethod · 0.76
logMethod · 0.76
testMethod · 0.76
contentTypeHeaderMethod · 0.76
isNotBlankMethod · 0.76