Package com.saperion.util
Class SaStringHelper
java.lang.Object
com.saperion.util.SaStringHelper
Utility class for helper methods.
- Author:
- mak
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcollectionToString(String separator, Collection<String> collection) Creates a string containing all strings in the collection separated by the specified separator.static StringReads the content of a Stream into a String.static booleanTest if the string is empty or not.static StringprepareDatabaseName(String dbName) Removes all '[', ']' and '"' from the passed string.static StringreaderToString(Reader is) Reads the entire content of a Reader into a String.static StringtoLowerCaseUnicode(String str) static StringtoUpperCaseUnicode(String str)
-
Field Details
-
EMPTY_STRING
- See Also:
-
-
Method Details
-
isEmpty
Test if the string is empty or not.- Parameters:
str- Incomming string- Returns:
- True, if the string is empty
-
readerToString
Reads the entire content of a Reader into a String.- Parameters:
is- input Reader- Returns:
String- Throws:
IOException- IOException
-
inputStreamToString
Reads the content of a Stream into a String.- Parameters:
is- the input stream- Returns:
String- Throws:
IOException- IOException
-
toLowerCaseUnicode
- Parameters:
str- original string- Returns:
- the
String, converted to lowercase.
-
toUpperCaseUnicode
- Parameters:
str- original string- Returns:
- the
String, converted to uppercase.
-
collectionToString
Creates a string containing all strings in the collection separated by the specified separator. It does not add whitespaces, so don't forget to add a whitespace to your separator if required.- Parameters:
separator- the separatorcollection- the collection- Returns:
- the string
-
prepareDatabaseName
Removes all '[', ']' and '"' from the passed string.- Parameters:
dbName- original database name- Returns:
- cleaned database name
-