public class StringUtils extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
StringUtils.StringUtilsFormatter<Type> |
static class |
StringUtils.ToStringFormatter |
Constructor and Description |
---|
StringUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
escapeHtml(String str) |
static boolean |
hasLowerCase(String string) |
static boolean |
hasUpperCase(String string) |
static String |
indent(String string) |
static String |
indent(String string,
int padding) |
static boolean |
isAscii(char ch) |
static boolean |
isAscii(String string) |
protected static boolean |
isDelimiter(String piece,
String previousPiece,
String endDelimiter) |
static boolean |
isEmpty(String value)
Null-safe check if string is empty.
|
static boolean |
isNotEmpty(String value)
Null-safe check if string is not empty
|
static boolean |
isWhitespace(CharSequence string) |
static String |
join(Collection<String> collection,
String delimiter) |
static String |
join(Collection<String> collection,
String delimiter,
boolean sorted) |
static String |
join(Collection collection,
String delimiter,
StringUtils.StringUtilsFormatter formatter) |
static String |
join(Collection collection,
String delimiter,
StringUtils.StringUtilsFormatter formatter,
boolean sorted) |
static String |
join(int[] array,
String delimiter) |
static String |
join(Integer[] array,
String delimiter) |
static String |
join(Map map,
String delimiter) |
static String |
join(Map map,
String delimiter,
StringUtils.StringUtilsFormatter formatter) |
static String |
join(Object[] array,
String delimiter,
StringUtils.StringUtilsFormatter formatter) |
static String |
join(String[] array,
String delimiter) |
static String |
limitSize(String string,
int maxLength) |
static String |
lowerCaseFirst(String string) |
static String |
pad(String value,
int length) |
static String[] |
processMutliLineSQL(String multiLineSQL,
boolean stripComments,
boolean splitStatements,
String endDelimiter)
Removes any comments from multiple line SQL using
stripComments(String)
and then extracts each individual statement using splitSQL(String, String) . |
static String |
repeat(String string,
int times) |
static List<String> |
splitAndTrim(String s,
String regex) |
static String[] |
splitSQL(String multiLineSQL,
String endDelimiter)
Splits a (possible) multi-line SQL statement along ;'s and "go"'s.
|
static String |
standardizeLineEndings(String string) |
static boolean |
startsWith(String value,
String startsWith)
Checks if
value starts with startsWith . |
static String |
stripComments(String multiLineSQL)
Searches through a String which contains SQL code and strips out
any comments that are between \/**\/ or anything that matches
SP--SP
|
static String |
trimToEmpty(String string) |
static String |
trimToNull(String string) |
static String |
upperCaseFirst(String string) |
public static String[] processMutliLineSQL(String multiLineSQL, boolean stripComments, boolean splitStatements, String endDelimiter)
stripComments(String)
and then extracts each individual statement using splitSQL(String, String)
.multiLineSQL
- A String containing all the SQL statementsstripComments
- If true then comments will be stripped, if false then they will be left in the codeprotected static boolean isDelimiter(String piece, String previousPiece, String endDelimiter)
public static String[] splitSQL(String multiLineSQL, String endDelimiter)
public static String stripComments(String multiLineSQL)
public static String join(Object[] array, String delimiter, StringUtils.StringUtilsFormatter formatter)
public static String join(Collection<String> collection, String delimiter)
public static String join(Collection collection, String delimiter, StringUtils.StringUtilsFormatter formatter)
public static String join(Collection collection, String delimiter, StringUtils.StringUtilsFormatter formatter, boolean sorted)
public static String join(Collection<String> collection, String delimiter, boolean sorted)
public static String join(Map map, String delimiter, StringUtils.StringUtilsFormatter formatter)
public static boolean hasUpperCase(String string)
public static boolean hasLowerCase(String string)
public static boolean isAscii(String string)
public static boolean isAscii(char ch)
public static boolean isEmpty(String value)
value
- String to be checkedpublic static boolean isNotEmpty(String value)
value
- String to be checkedpublic static boolean startsWith(String value, String startsWith)
value
starts with startsWith
.value
- startsWith
- value
starts with startsWith
, otherwise false. If any of arguments is null returns falsepublic static boolean isWhitespace(CharSequence string)
Copyright © 2016 Liquibase.org. All rights reserved.