|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pentaho.reporting.libraries.base.util.StringUtils
public class StringUtils
String utilities.
Method Summary | |
---|---|
static boolean |
endsWithIgnoreCase(String base,
String end)
Helper functions to query a strings end portion. |
static boolean |
equals(String s1,
String s2)
Determines if the two Strings are equals (taking nulls into account). |
static boolean |
equalsIgnoreCase(String s1,
String s2)
Determines if the two Strings are equals ingnoring case sensitivity (taking nulls into account). |
static String |
getLineSeparator()
Queries the system properties for the line separator. |
static boolean |
isEmpty(String source)
Determines if the string is empty or null . |
static boolean |
isEmpty(String source,
boolean trim)
Determines if the string is empty or null . |
static String |
makeUniqueName(String[] knownNames,
String pattern)
Computes a unique name using the given known-names array as filter. |
static String[] |
merge(String[] first,
String[] second)
Merges the contents of the first and second array returning a array that contains only unique strings. |
static String |
propertiesToString(Properties parameters,
String separator)
Take a Properties map and convert it to a semicolon separated key/value list where the key and value are separated by an equal sign (i.e. |
static String[] |
split(String string)
Splits a given string on any whitespace character. |
static String[] |
split(String string,
String separator)
Splits a given string at the given separator string. |
static String[] |
split(String string,
String separator,
String quote)
Splits a given string at the given separator string. |
static String[] |
splitCSV(String string,
String separator)
Splits a given string at the given separator string. |
static String[] |
splitCSV(String string,
String separator,
String quate)
Splits a given string at the given separator string. |
static boolean |
startsWithIgnoreCase(String base,
String start)
Helper functions to query a strings start portion. |
static Properties |
stringToProperties(String propertiesString,
String deliminator)
Takes a string that has the format "key=value;key2=value2;..." and converts the string into a Properties map. |
static boolean |
toBoolean(String source)
Returns true if the source string evaulates (case insensative and trimmed) to true ,
yes , or on . |
static boolean |
toBoolean(String source,
boolean nullDefault)
Returns true if the source string evaulates (case insensative and trimmed) to true ,
yes , or on . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean startsWithIgnoreCase(String base, String start)
base
- the base string.start
- the starting text.
public static boolean endsWithIgnoreCase(String base, String end)
base
- the base string.end
- the ending text.
public static String getLineSeparator()
public static String[] split(String string)
string
- the text to be split.
public static String[] split(String string, String separator)
string
- the text to be split.separator
- the separator chacters used for the split.
public static String[] split(String string, String separator, String quote)
string
- the text to be split.separator
- the separator characters used for the split.quote
- the quoting character.
public static String[] splitCSV(String string, String separator)
string
- the text to be split.separator
- the separator chacters used for the split.
public static String[] splitCSV(String string, String separator, String quate)
string
- the text to be split.separator
- the separator chacters used for the split.quate
- the quoting character.
public static String makeUniqueName(String[] knownNames, String pattern)
knownNames
- the list of known names.pattern
- the name pattern, which should have one integer slot to create derived names.
public static String[] merge(String[] first, String[] second)
first
- the first array to be merged.second
- the second array to be merged.
public static boolean toBoolean(String source)
true
if the source string evaulates (case insensative and trimmed) to true
,
yes
, or on
. It will return false
otherwise (including null
).
source
- the string to check
true
if the source string evaulates to true
or similar value,
false
otherwise.public static boolean toBoolean(String source, boolean nullDefault)
true
if the source string evaulates (case insensative and trimmed) to true
,
yes
, or on
. It will return false otherwise. If the source string
is null
, it will return the value of the default.
- Parameters:
source
- the string to checknullDefault
- to value to return if the source string is null
- Returns:
true
if the source string evaulates to true
or similar value,
false
otherwise.
public static boolean isEmpty(String source)
null
.
source
- the string to check
true
if the source string is null
or an emptry string,
false
otherwise.public static boolean isEmpty(String source, boolean trim)
null
. If the trim is true
,
the string will be trimmed before checking for an empty string.
source
- the string to checktrim
- indicates if the string should be trimmed before checking for an empty string.
true
if the source string is null
or an emptry string,
false
otherwise.public static boolean equals(String s1, String s2)
s1
- the first string to compare.s2
- the second string to compare.
true
if both string are null or the contain the same value, false
otherwisepublic static boolean equalsIgnoreCase(String s1, String s2)
s1
- the first string to compare.s2
- the second string to compare.
true
if both string are null or the contain the same case-insensitive value, false
otherwisepublic static String propertiesToString(Properties parameters, String separator)
parameters
-
public static Properties stringToProperties(String propertiesString, String deliminator)
propertiesString
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |