@API(status=INTERNAL, since="1.0") public final class StringUtils extends java.lang.Object
Strings
,
CharSequences
, etc.
These utilities are intended solely for usage within the JUnit framework itself. Any usage by external parties is not supported. Use at your own risk!
Modifier and Type | Method | Description |
---|---|---|
static boolean |
containsIsoControlCharacter(java.lang.String str) |
Determine if the supplied
String contains any ISO control characters. |
static boolean |
containsWhitespace(java.lang.String str) |
Determine if the supplied
String contains any whitespace characters. |
static boolean |
doesNotContainIsoControlCharacter(java.lang.String str) |
Determine if the supplied
String does not contain any ISO control
characters. |
static boolean |
doesNotContainWhitespace(java.lang.String str) |
Determine if the supplied
String does not contain any whitespace
characters. |
static boolean |
isBlank(java.lang.String str) |
Determine if the supplied
String is blank (i.e.,
null or consisting only of whitespace characters). |
static boolean |
isNotBlank(java.lang.String str) |
Determine if the supplied
String is not blank. |
static java.lang.String |
nullSafeToString(java.lang.Object obj) |
Convert the supplied
Object to a String using the
following algorithm. |
public static boolean isBlank(java.lang.String str)
String
is blank (i.e.,
null
or consisting only of whitespace characters).str
- the string to check; may be null
true
if the string is blankisNotBlank(String)
public static boolean isNotBlank(java.lang.String str)
String
is not blank.str
- the string to check; may be null
true
if the string is not blankisBlank(String)
public static boolean containsWhitespace(java.lang.String str)
String
contains any whitespace characters.str
- the string to check; may be null
true
if the string contains whitespacecontainsIsoControlCharacter(String)
,
Character.isWhitespace(int)
public static boolean doesNotContainWhitespace(java.lang.String str)
String
does not contain any whitespace
characters.str
- the string to check; may be null
true
if the string does not contain whitespacecontainsWhitespace(String)
,
containsIsoControlCharacter(String)
,
Character.isWhitespace(int)
public static boolean containsIsoControlCharacter(java.lang.String str)
String
contains any ISO control characters.str
- the string to check; may be null
true
if the string contains an ISO control charactercontainsWhitespace(String)
,
Character.isISOControl(int)
public static boolean doesNotContainIsoControlCharacter(java.lang.String str)
String
does not contain any ISO control
characters.str
- the string to check; may be null
true
if the string does not contain an ISO control charactercontainsIsoControlCharacter(String)
,
containsWhitespace(String)
,
Character.isISOControl(int)
public static java.lang.String nullSafeToString(java.lang.Object obj)
Object
to a String
using the
following algorithm.
null
, this method returns "null"
.Arrays#toString(...)
variant will be used to convert it to a String.Arrays#deepToString(Object[])
will be used to convert it to a String.toString()
on the object
will be returned.obj
- the object to convert to a String; may be null
Arrays.deepToString(Object[])
,
ClassUtils.nullSafeToString(Class...)