java.lang.Object
io.ebean.util.StringHelper
Utility String class that supports String manipulation functions.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondelimitedToMap
(String source, String listDelimiter, String nameValueSeparator) Parses out a list of Name Value pairs that are delimited together.static boolean
Return true if the value is null or an empty string.static String
removeNewLines
(String source) Return new line and carriage return with space.static String
This method takes a String and will replace all occurrences of the match String with that of the replace String.static String[]
splitNames
(String names) Splits at any whitespace "," or ";" and trims the result.
-
Constructor Details
-
StringHelper
public StringHelper()
-
-
Method Details
-
isNull
Return true if the value is null or an empty string. -
delimitedToMap
public static Map<String,String> delimitedToMap(String source, String listDelimiter, String nameValueSeparator) Parses out a list of Name Value pairs that are delimited together. Will always return a StringMap. If allNameValuePairs is null, or no name values can be parsed out an empty StringMap is returned.- Parameters:
source
- the entire string to be parsed.listDelimiter
- (typically ';') the delimited between the listnameValueSeparator
- (typically '=') the separator between the name and value
-
replace
This method takes a String and will replace all occurrences of the match String with that of the replace String.- Parameters:
source
- the source stringmatch
- the string used to find a matchreplace
- the string used to replace match with- Returns:
- the source string after the search and replace
-
removeNewLines
Return new line and carriage return with space. -
splitNames
Splits at any whitespace "," or ";" and trims the result. It does not return empty entries.
-