Package rife.bld.extension.tools
Class TextTools
java.lang.Object
rife.bld.extension.tools.TextTools
Utility methods for working with text and character sequences.
Provides null‑safe checks for blankness and emptiness across CharSequence
and general Object inputs, along with a whitespace‑insensitive equality
comparison. All operations avoid unnecessary allocations and optimize for
String instances where possible.
- Since:
- 1.0
- Author:
- Erik C. Thauvin
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanequalsIgnoreWhitespace(CharSequence... strings) Compares two or more character sequences by removing all whitespace.static booleanisBlank(CharSequence str) Checks if a character sequence isnull, empty, or contains only whitespace characters.static booleanisBlank(CharSequence... strings) Checks if all character sequences arenull, empty, or contain only whitespace characters.static booleanChecks if all string objects arenull, empty, or contain only whitespace characters.static booleanisEmpty(CharSequence str) Checks if a character sequence isnullor empty.static booleanisEmpty(CharSequence... strings) Checks if all character sequences arenullor empty.static booleanChecks if all string objects arenullor their string representations are empty.static booleanisNotBlank(CharSequence str) Checks if a character sequence is notnull, not empty, and not whitespace-only.static booleanisNotBlank(CharSequence... strings) Checks if all character sequences are notnull, not empty, and not whitespace-only.static booleanisNotBlank(Object... strings) Checks if all string objects are notnull, not empty, and not whitespace-only.static booleanisNotEmpty(CharSequence str) Checks if a character sequence is notnulland not empty.static booleanisNotEmpty(CharSequence... strings) Checks if all character sequences are notnulland not empty.static booleanisNotEmpty(Object... strings) Checks if all string objects are notnulland their string representations are not empty.
-
Method Details
-
equalsIgnoreWhitespace
Compares two or more character sequences by removing all whitespace.- Parameters:
strings- the character sequences to compare- Returns:
trueif all character sequences are equivalent when whitespace is ignored,falseotherwise- Since:
- 1.0
-
isBlank
Checks if a character sequence isnull, empty, or contains only whitespace characters.- Parameters:
str- the character sequence to check- Returns:
trueif the character sequence isnull, empty, or whitespace-only;falseotherwise- Since:
- 1.0
-
isBlank
Checks if all character sequences arenull, empty, or contain only whitespace characters.- Parameters:
strings- the character sequences to check- Returns:
trueif all character sequences arenull, empty, or whitespace-only;falseotherwise- Since:
- 1.0
-
isBlank
Checks if all string objects arenull, empty, or contain only whitespace characters.- Parameters:
strings- the string objects to check- Returns:
trueif all string objects arenull, their string representations are empty, or their string representations are whitespace-only;falseotherwise- Since:
- 1.0
-
isEmpty
Checks if a character sequence isnullor empty.- Parameters:
str- the character sequence to check- Returns:
trueif the character sequence isnullor empty;falseotherwise- Since:
- 1.0
-
isEmpty
Checks if all character sequences arenullor empty.- Parameters:
strings- the character sequences to check- Returns:
trueif all character sequences arenullor empty;falseotherwise- Since:
- 1.0
-
isEmpty
Checks if all string objects arenullor their string representations are empty.- Parameters:
strings- the string objects to check- Returns:
trueif all objects arenullor their string representations are empty;falseotherwise- Since:
- 1.0
-
isNotBlank
Checks if a character sequence is notnull, not empty, and not whitespace-only.- Parameters:
str- the character sequence to check- Returns:
trueif the character sequence is notnull, not empty, and not whitespace-only;falseotherwise- Since:
- 1.0
-
isNotBlank
Checks if all character sequences are notnull, not empty, and not whitespace-only.- Parameters:
strings- the character sequences to check- Returns:
trueif all character sequences are notnull, not empty, and not whitespace-only;falseotherwise- Since:
- 1.0
-
isNotBlank
Checks if all string objects are notnull, not empty, and not whitespace-only.- Parameters:
strings- the string objects to check- Returns:
trueif all objects are notnull, their string representations are not empty, and their string representations are not whitespace-only;falseotherwise- Since:
- 1.0
-
isNotEmpty
Checks if a character sequence is notnulland not empty.- Parameters:
str- the character sequence to check- Returns:
trueif the character sequence is notnulland not empty;falseotherwise- Since:
- 1.0
-
isNotEmpty
Checks if all character sequences are notnulland not empty.- Parameters:
strings- the character sequences to check- Returns:
trueif all character sequences are notnulland not empty;falseotherwise- Since:
- 1.0
-
isNotEmpty
Checks if all string objects are notnulland their string representations are not empty.- Parameters:
strings- the string objects to check- Returns:
trueif all string objects are notnulland their string representations are not empty;falseotherwise- Since:
- 1.0
-