|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.googlecode.jbp.common.requirements.AbstractRequirements
com.googlecode.jbp.common.requirements.ParamRequirements
public final class ParamRequirements
Provides useful methods to check for method parameter validity.
Unless explicitly stated, these methods throw an
java.lang.IllegalArgumentException if the parameter is not
valid.
Example of null parameter check:
ParamRequirements.INSTANCE.requireNotNull(firstParameter);
instead of
if (firstParameter == null) {
throw new IllegalArgumentException("First parameter must not be null.");
}
| Field Summary | |
|---|---|
static ParamRequirements |
INSTANCE
Singleton instance. |
| Method Summary | |
|---|---|
protected void |
onConditionNotMet(String messageParam)
Called if a condition is not met. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final ParamRequirements INSTANCE
| Method Detail |
|---|
protected void onConditionNotMet(String messageParam)
AbstractRequirementsRequirementException.
onConditionNotMet in class AbstractRequirementsmessageParam - The associated message.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||