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 String
collectionToString
(String separator, Collection<String> collection) Creates a string containing all strings in the collection separated by the specified separator.static String
Reads the content of a Stream into a String.static boolean
Test if the string is empty or not.static String
prepareDatabaseName
(String dbName) Removes all '[', ']' and '"' from the passed string.static String
readerToString
(Reader is) Reads the entire content of a Reader into a String.static String
toLowerCaseUnicode
(String str) static String
toUpperCaseUnicode
(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
-