|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.util.lang.Arg
public final class Arg
Utility class to check an argument.
Method Summary | ||
---|---|---|
static
|
checkNotBlank(String name, T value) Checks if value is blank. |
|
static
|
checkNotBlank(String name, T value, String message) Checks if value is blank providing an additional message. |
|
static
|
checkNotBlankExceptNull(String name, T value) Checks if value is blank except null . |
|
static
|
checkNotBlankExceptNull(String name, T value, String message) Checks if value is blank except null providing an additional message. |
|
static
|
checkNotNull(String name, T value) Checks if value is null . |
|
static
|
checkNotNull(String name, T value, String message) Checks if value is null providing an additional message. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <T> T checkNotNull(String name, T value) throws NullPointerException
value
is
null
.
T
- the type of the argument to check.
name
- the name of the argument of error reporting. Not used if no exception is thrown. May be
null
, although not recommended.
value
- the value of the argument to check to be not
null
.
value
.
NullPointerException
- if
value
is
null
.
public static <T> T checkNotNull(String name, T value, String message) throws NullPointerException
value
is
null
providing an additional message.
T
- the type of the argument to check.
name
- the name of the argument of error reporting. Not used if no exception is thrown. May be
null
, although not recommended.
value
- the value of the argument to check to be not
null
.
message
- the message to pass to the exception as additional information to the standard message being generated.
value
.
NullPointerException
- if
value
is
null
.
public static <T extends CharSequence> T checkNotBlank(String name, T value) throws NullArgumentException, BlankArgumentException
value
is blank.
T
- a character sequence like a
String
.
name
- the name of the argument of error reporting. Not used if no exception is thrown. May be
null
, although not recommended.
value
- the value of the argument to check to be not blank.
value
.
NullArgumentException
- if
value
is
null
.
BlankArgumentException
- if
value
is blank.
public static <T extends CharSequence> T checkNotBlank(String name, T value, String message) throws NullArgumentException, BlankArgumentException
value
is blank providing an additional message.
T
- a character sequence like a
String
.
name
- the name of the argument of error reporting. Not used if no exception is thrown. May be
null
, although not recommended.
value
- the value of the argument to check to be not blank.
message
- the message to pass to the exception as additional information to the standard message being generated.
value
.
NullArgumentException
- if
value
is
null
.
BlankArgumentException
- if
value
is blank.
public static <T extends CharSequence> T checkNotBlankExceptNull(String name, T value) throws BlankExceptNullArgumentException
value
is blank except
null
.
T
- a character sequence like a
String
.
name
- the name of the argument of error reporting. Not used if no exception is thrown. May be
null
, although not recommended.
value
- the value of the argument to check to be not blank but may be
null
.
value
.
BlankExceptNullArgumentException
- if
value
is blank and not
null
.
public static <T extends CharSequence> T checkNotBlankExceptNull(String name, T value, String message) throws BlankExceptNullArgumentException
value
is blank except
null
providing an additional message.
T
- a character sequence like a
String
.
name
- the name of the argument of error reporting. Not used if no exception is thrown. May be
null
, although not recommended.
value
- the value of the argument to check to be not blank but may be
null
.
message
- the message to pass to the exception as additional information to the standard message being generated.
value
.
BlankExceptNullArgumentException
- if
value
is blank and not
null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |