Class StringUtils
java.lang.Object
org.variantsync.diffdetective.util.StringUtils
A collection of useful utilities related to string processing.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic voidclear(StringBuilder builder) Remove the contentbuilderso it can be reused for a new string.static Stringprivate static voidprettyPrintNestedCollections(String indent, StringBuilder b, Collection<?> os) Append a human readable string representation ofcollectiontob.static StringprettyPrintNestedCollections(Collection<?> collection) Returns a human readable string representation ofcollection.
-
Field Details
-
LINEBREAK
An operating system independent line break used in almost all internal strings.- See Also:
-
LINEBREAK_REGEX
A regex to identify line breaks of any operating system .
-
-
Constructor Details
-
StringUtils
public StringUtils()
-
-
Method Details
-
clear
Remove the contentbuilderso it can be reused for a new string. -
prettyPrintNestedCollections
Append a human readable string representation ofcollectiontob.- Parameters:
indent- an indent prepended to all appended linesb- a string builder on which result is appendedos- the collection to be pretty printed
-
prettyPrintNestedCollections
Returns a human readable string representation ofcollection. -
clamp
-
getLeadingWhitespace
- Returns:
- the longest prefix of the given string that contains only of whitespace
-