Class StringUtils
java.lang.Object
net.adoptopenjdk.icedteaweb.StringUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanhasPrefixMatch(String heyStack, String... candidates) If a candidate is a prefix of the heyStack, then this is a match.static booleanDetermines whether a given string isnull, empty, or only contains whitespace.splitIntoMultipleLines(String s, int maxCharsPerLine) Method for splitting long strings into multiple lines.static StringsubstringBeforeLast(String s, String separator) static String
-
Field Details
-
EMPTY_STRING
- See Also:
-
-
Constructor Details
-
StringUtils
private StringUtils()
-
-
Method Details
-
isBlank
Determines whether a given string is
null, empty, or only contains whitespace. If it contains anything other than whitespace then the string is not considered to be blank and the method returnsfalse.- Parameters:
str- The string to test.- Returns:
trueif the string isnull, or blank.
-
splitIntoMultipleLines
Method for splitting long strings into multiple lines. This is mainly used for pretty printing. Whitespace characters in the input string are not handled specially.All lines will have the length passed as
maxCharsPerLineexcept the last one which may be shorter.If null is passed instead of a string then an empty list is returned. If zero or a negative maxCharsPerLine is passed then a list containing the input string as the only element is returned.
- Parameters:
s- the string to be split into multiple linesmaxCharsPerLine- the maximum characters a line may contain.- Returns:
- a list of strings with the maximal length as specified.
-
hasPrefixMatch
If a candidate is a prefix of the heyStack, then this is a match. If no candidates are specified, it matches any heyStack.- Parameters:
heyStack- the string to match candidates againstcandidates- the strings to test as possible prefixes- Returns:
- true if the any of the candidates is a prefix match of the heystack or if there are no candidates.
-
substringBeforeLast
-
urlEncode
-