|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.util.lang.ArgumentChecker
@NotThreadSafe public final class ArgumentChecker
Collects exceptions. Especially useful for builders.
Constructor Summary | |
---|---|
ArgumentChecker(String message) Default constructor. |
Method Summary | |
---|---|
void |
add(Throwable t) Adds a throwable. |
void |
check() Checks if an exception has been encountered. |
void |
notBlank(String name, String value) Checks if value is blank. |
void |
notBlankExceptNull(String name, String value) Checks if value is blank except null . |
void |
notNull(String name, Object value) Checks if value is null . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArgumentChecker(String message) throws IllegalArgumentException
message
- the message to prepend to the message if throwables have been collected.
IllegalArgumentException
- if message is blank.
Method Detail |
---|
public void notNull(String name, Object value)
value
is
null
.
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
.
public void notBlank(String name, String value)
value
is blank.
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.
public void notBlankExceptNull(String name, String value)
value
is blank except
null
.
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
.
public void add(Throwable t)
t
- the throwable to add.
public void check() throws IllegalArgumentException
IllegalArgumentException
- if at least on exception has been encountered.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |