Package nva.commons.core
Class StringUtils
- java.lang.Object
-
- nva.commons.core.StringUtils
-
public final class StringUtils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDOUBLE_WHITESPACEstatic java.lang.StringEMPTY_STRINGstatic java.lang.StringSPACEstatic java.lang.StringWHITESPACES
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static booleanisBlank(java.lang.String input)Checks if string input is blank or null.static booleanisEmpty(java.lang.String input)Checks if string input is empty or null.static booleanisNotBlank(java.lang.String string)Checks if string is neither null or blank.static booleanisNotEmpty(java.lang.String string)Checks if string is neither null or empty.static booleanisNotNullOrBlank(java.lang.String string)Deprecated, for removal: This API element is subject to removal in a future version.static booleanisNotNullOrEmpty(java.lang.String string)Deprecated, for removal: This API element is subject to removal in a future version.static booleanisNullOrBlank(java.lang.String string)Deprecated, for removal: This API element is subject to removal in a future version.static booleanisNullOrEmpty(java.lang.String string)Deprecated, for removal: This API element is subject to removal in a future version.static java.lang.StringremoveMultipleWhiteSpaces(java.lang.String input)Replaces multiple consecutive whitespaces with a single whitespace.static java.lang.StringremoveWhiteSpaces(java.lang.String input)Remove all whitespaces.static java.lang.StringreplaceWhiteSpacesWithSpace(java.lang.String str)Replaces whitespaces with space.
-
-
-
Field Detail
-
DOUBLE_WHITESPACE
public static final java.lang.String DOUBLE_WHITESPACE
- See Also:
- Constant Field Values
-
WHITESPACES
public static final java.lang.String WHITESPACES
- See Also:
- Constant Field Values
-
SPACE
public static final java.lang.String SPACE
- See Also:
- Constant Field Values
-
EMPTY_STRING
public static final java.lang.String EMPTY_STRING
- See Also:
- Constant Field Values
-
-
Method Detail
-
removeMultipleWhiteSpaces
public static java.lang.String removeMultipleWhiteSpaces(java.lang.String input)
Replaces multiple consecutive whitespaces with a single whitespace.- Parameters:
input- A string with or without multiple consecutive whitespaces.- Returns:
- A string without multiple consecutive whitespaces where are whitespaces have been replaced by a space.
-
removeWhiteSpaces
public static java.lang.String removeWhiteSpaces(java.lang.String input)
Remove all whitespaces.- Parameters:
input- A string with or without multiple consecutive whitespaces.- Returns:
- a string without spaces.
-
isBlank
public static boolean isBlank(java.lang.String input)
Checks if string input is blank or null.- Parameters:
input- input string- Returns:
trueif blank.
-
isEmpty
public static boolean isEmpty(java.lang.String input)
Checks if string input is empty or null.- Parameters:
input- input string- Returns:
trueif empty.
-
replaceWhiteSpacesWithSpace
public static java.lang.String replaceWhiteSpacesWithSpace(java.lang.String str)
Replaces whitespaces with space.- Parameters:
str- input string.- Returns:
- string with all whitespaces replaced by spaces
-
isNotNullOrEmpty
@Deprecated(forRemoval=true) public static boolean isNotNullOrEmpty(java.lang.String string)
Deprecated, for removal: This API element is subject to removal in a future version.Checks if string is neither null or empty.- Parameters:
string- string to check- Returns:
trueif string is neither null or empty.- See Also:
isNotEmpty(String)
-
isNotEmpty
public static boolean isNotEmpty(java.lang.String string)
Checks if string is neither null or empty.- Parameters:
string- string to check- Returns:
trueif string is neither null or empty.
-
isNotNullOrBlank
@Deprecated(forRemoval=true) public static boolean isNotNullOrBlank(java.lang.String string)
Deprecated, for removal: This API element is subject to removal in a future version.Checks if string is neither null or blank.- Parameters:
string- string to check- Returns:
trueif string is neither null or empty.- See Also:
isNotBlank(String)
-
isNotBlank
public static boolean isNotBlank(java.lang.String string)
Checks if string is neither null or blank.- Parameters:
string- string to check- Returns:
trueif string is neither null or empty.
-
isNullOrEmpty
@Deprecated(forRemoval=true) public static boolean isNullOrEmpty(java.lang.String string)
Deprecated, for removal: This API element is subject to removal in a future version.Checks if string is null or empty.- Parameters:
string- string to check- Returns:
trueif string is null or empty.- See Also:
isEmpty(String)
-
isNullOrBlank
@Deprecated(forRemoval=true) public static boolean isNullOrBlank(java.lang.String string)
Deprecated, for removal: This API element is subject to removal in a future version.Checks if string is null or blank.- Parameters:
string- string to check- Returns:
trueif string is null or empty.- See Also:
isBlank(String)
-
-