Package io.ebean.util
Class StringHelper
- java.lang.Object
-
- io.ebean.util.StringHelper
-
public class StringHelper extends Object
Utility String class that supports String manipulation functions.
-
-
Constructor Summary
Constructors Constructor Description StringHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<String,String>
delimitedToMap(String source, String listDelimiter, String nameValueSeparator)
Parses out a list of Name Value pairs that are delimited together.static boolean
isNull(String value)
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
replace(String source, String match, String replace)
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 Detail
-
StringHelper
public StringHelper()
-
-
Method Detail
-
isNull
public static boolean isNull(String value)
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
public static String replace(String source, String match, String 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
public static String removeNewLines(String source)
Return new line and carriage return with space.
-
splitNames
public static String[] splitNames(String names)
Splits at any whitespace "," or ";" and trims the result. It does not return empty entries.
-
-