|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fuin.objects4j.Contract
public final class Contract
Utility class for assertions on objects.
| Method Summary | ||
|---|---|---|
static void |
requireArgNotNull(java.lang.String name,
java.lang.Object value)
Checks if the value is not null. |
|
static
|
requireValid(T value)
Checks if the given value is valid and throws an IllegalArgumentException otherwise. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void requireArgNotNull(java.lang.String name,
java.lang.Object value)
throws ContractViolationException
name - Name of the value for a possible error message.value - Value to check.
ContractViolationException - The value was null.
public static <T> void requireValid(T value)
throws ContractViolationException
IllegalArgumentException otherwise.
T - Type of the argument.value - Value to check.
ContractViolationException - The value is invalid.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||