|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.gwt.http.client.StringValidator
final class StringValidator
Utility class for validating strings. TODO(mmendez): Is there a better place for this?
Method Summary | |
---|---|
static boolean |
isEmptyOrNullString(java.lang.String string)
Returns true if the string is empty or null. |
static void |
throwIfEmptyOrNull(java.lang.String name,
java.lang.String value)
Throws if value is null or empty. |
static void |
throwIfNull(java.lang.String name,
java.lang.Object value)
Throws a NullPointerException if the value is null . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean isEmptyOrNullString(java.lang.String string)
string
- to test if null or empty
public static void throwIfEmptyOrNull(java.lang.String name, java.lang.String value)
value
is null
or empty. This method
ignores leading and trailing whitespace.
name
- the name of the value, used in error messagesvalue
- the string value that needs to be validated
java.lang.IllegalArgumentException
- if the string is empty, or all whitespace
java.lang.NullPointerException
- if the string is null
public static void throwIfNull(java.lang.String name, java.lang.Object value)
NullPointerException
if the value is null
.
name
- the name of the value, used in error messagesvalue
- the value that needs to be validated
java.lang.NullPointerException
- if the value is null
|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |