|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hivemind.util.Defense
public final class Defense
Simple utilities for defensive programming.
Method Summary | |
---|---|
static void |
fieldNotNull(java.lang.Object value,
java.lang.String fieldName)
Check for null field value when not allowed. |
static void |
isAssignable(java.lang.Object parameter,
java.lang.Class expectedType,
java.lang.String parameterName)
Check that a parameter is not null, and assignable to a particular type. |
static void |
notNull(java.lang.Object parameter,
java.lang.String parameterName)
Check for null parameter when not allowed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void notNull(java.lang.Object parameter, java.lang.String parameterName)
java.lang.NullPointerException
- if parameter is null (the message indicates the name of the parameter).public static void fieldNotNull(java.lang.Object value, java.lang.String fieldName)
java.lang.NullPointerException
- if field is null (the message indicates the name of the field).public static void isAssignable(java.lang.Object parameter, java.lang.Class expectedType, java.lang.String parameterName)
java.lang.ClassCastException
- if not assignable (with a useable message)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |