Package org.ow2.clif.jenkins.utils
Class StringUtils
java.lang.Object
org.ow2.clif.jenkins.utils.StringUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic intcountMatches(String value, int character) Count the number of character occurrences in a stringstatic booleanendsWithIgnoreCase(String value, String suffix) Checks if a string ends with a given string, in a case-insensitive waystatic booleanChecks a string is null or empty, trimming whitespacesstatic booleanisNotBlank(String value) Checks a string is not null and not empty, trimming whitespaces
-
Method Details
-
countMatches
Count the number of character occurrences in a string- Parameters:
value- the source string where to look for character occurrencescharacter- the character to look for- Returns:
- the number of occurrences of the given character in the given string value, or 0 if value is null
-
endsWithIgnoreCase
Checks if a string ends with a given string, in a case-insensitive way- Parameters:
value- the full stringsuffix- the terminating substring to check, case-insensitive- Returns:
- true if value is non-null and contains suffix, false otherwise.
Special cases:
- True when suffix is the empty string and value is non-null
- False when suffix is null
-
isBlank
Checks a string is null or empty, trimming whitespaces- Returns:
- true if the given string is null or empty, regardless of possible whitespaces, false otherwise
-
isNotBlank
Checks a string is not null and not empty, trimming whitespaces- Returns:
- true if the given string is not null and not empty, regardless of possible whitespaces, false otherwise
-