Package org.wso2.carbon.utils
Class StringUtils
java.lang.Object
org.wso2.carbon.utils.StringUtils
This class contains utility methods for Strings.
- Since:
- 1.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns non-emptyOptional<String>, if the givenStringis non-empty after applying trim() operation.static booleanisNullOrEmpty(String str) Check whether the givenStringis null or empty.static booleanCheck whether the givenStringis null of empty after the trim operation.
-
Constructor Details
-
StringUtils
public StringUtils()
-
-
Method Details
-
isNullOrEmpty
Check whether the givenStringis null or empty.- Parameters:
str- input string- Returns:
- true if the given
Stringis null or empty.
-
isNullOrEmptyAfterTrim
Check whether the givenStringis null of empty after the trim operation.- Parameters:
str- input string.- Returns:
- 'true' if the given
Stringis null or empty after trim.
-
getNonEmptyStringAfterTrim
Returns non-emptyOptional<String>, if the givenStringis non-empty after applying trim() operation.- Parameters:
str- inputString.- Returns:
Optional<String>, if the givenStringis non-empty after applying trim() operation. If not an emptyOptional<String>will be returned.
-