|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectno.inspera.services.pedal.utils.StringUtils
public class StringUtils
Utility class for working with String
class.
Field Summary | |
---|---|
static java.lang.String |
ENCODING
|
Constructor Summary | |
---|---|
StringUtils()
|
Method Summary | |
---|---|
static boolean |
anyEquals(java.lang.String firstString,
java.lang.String... strings)
Compares firstString to the other specified strings. |
static boolean |
anyEqualsIgnoreCase(java.lang.String firstString,
java.lang.String... strings)
|
static boolean |
anyStartsWithIgnoreCase(java.lang.String firstString,
java.lang.String... strings)
|
static void |
appendIfNotNull(java.lang.String tagName,
java.lang.Object value,
java.lang.StringBuffer s)
Appends the following value as tag specified by tagName if value is not null |
static java.lang.String |
capitalize(java.lang.String s)
|
static java.lang.String |
checkNull(java.lang.Object s)
|
static java.lang.String |
checkNull(java.lang.String s)
Checks if the string is null. |
static java.lang.String |
decode(java.lang.String str)
Decodes the string with default system encoding. |
static boolean |
empty(java.lang.Object s)
Checks if the specified string is null or not. |
static java.lang.String |
encode(java.lang.String str)
Encodes the given string with the default system encoding. |
static boolean |
endsWith(java.lang.String original,
java.lang.String... suffixes)
Tests if this string ends with the specified suffix. |
static boolean |
equals(java.lang.String s1,
java.lang.String s2)
Compares this string to the specified object. |
static boolean |
hasLength(java.lang.String s)
Checks if the specified string is null or not. |
static boolean |
isNumber(java.lang.String str)
Checks if the specified string represents a number. |
static boolean |
isParseableNumber(java.lang.Object obj)
Checks if the type of the Object is string and checks if it can be parsed as a Number. |
static boolean |
isTrue(java.lang.String str)
Checks if the specified string is true. |
static java.lang.String |
stackTraceToString(java.lang.Throwable t)
Prints and returns a string that contains the stack trace of this exception |
static boolean |
startsWith(java.lang.String s,
java.lang.String prefix)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ENCODING
Constructor Detail |
---|
public StringUtils()
Method Detail |
---|
public static boolean equals(java.lang.String s1, java.lang.String s2)
true
if and only if both arguments are
null
or s1
is a String
object that represents
the same sequence of characters as s2
object.
s1
- first Strings2
- second String
true
if both arguments are null or String.equals(Object)
returns truepublic static boolean anyEquals(java.lang.String firstString, java.lang.String... strings)
firstString
- the first string to be comparedstrings
- an array of strings to be compared with firstString
public static boolean anyEqualsIgnoreCase(java.lang.String firstString, java.lang.String... strings)
public static boolean anyStartsWithIgnoreCase(java.lang.String firstString, java.lang.String... strings)
public static java.lang.String stackTraceToString(java.lang.Throwable t)
t
- throwable that needs to be printed
public static java.lang.String checkNull(java.lang.String s)
This method is usefull when we would like to avoid null strings.
s
- string to be checked.
public static java.lang.String checkNull(java.lang.Object s)
public static void appendIfNotNull(java.lang.String tagName, java.lang.Object value, java.lang.StringBuffer s)
tagName
- the tag name of xml elementvalue
- the value to be appended.s
- stringbuffer to be appended to.public static java.lang.String encode(java.lang.String str)
str
- string to be encoded.
public static java.lang.String decode(java.lang.String str)
str
- string to be decoded
public static boolean isNumber(java.lang.String str)
str
- string representing number
public static boolean isParseableNumber(java.lang.Object obj)
obj
- Object to be checked.
public static boolean isTrue(java.lang.String str)
str
- string to be checked
public static boolean empty(java.lang.Object s)
s
- string to be checked
public static boolean startsWith(java.lang.String s, java.lang.String prefix)
public static boolean hasLength(java.lang.String s)
s
- string to be checked
public static boolean endsWith(java.lang.String original, java.lang.String... suffixes)
original
- suffixes
- the suffixes.
true
if the character sequence represented by the
suffixes argument is a suffix of the character sequence represented by
this object; false
otherwise. Note that the
result will be true
if the argument is the
empty string or is equal to this String
object
as determined by the Object.equals(Object)
method.public static java.lang.String capitalize(java.lang.String s)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |