Class StringUtils
java.lang.Object
org.pf4j.util.StringUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringAdds a substring only if the source string does not already start with the substring, otherwise returns the source string.static StringFormat the string.static booleanisNotNullOrEmpty(String str) static booleanisNullOrEmpty(String str)
-
Constructor Details
-
StringUtils
public StringUtils()
-
-
Method Details
-
isNullOrEmpty
-
isNotNullOrEmpty
-
format
Format the string. Replace "{}" with %s and format the string usingString.format(String, Object...). -
addStart
Adds a substring only if the source string does not already start with the substring, otherwise returns the source string.
A
nullsource string will returnnull. An empty ("") source string will return the empty string. Anullsearch string will return the source string.StringUtils.addStart(null, *) = * StringUtils.addStart("", *) = * StringUtils.addStart(*, null) = * StringUtils.addStart("domain.com", "www.") = "www.domain.com" StringUtils.addStart("abc123", "abc") = "abc123"- Parameters:
str- the source String to search, may be nulladd- the String to search for and add, may be null- Returns:
- the substring with the string added if required
-