|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tapestry5.ioc.internal.util.Defense
public final class Defense
Static utility methods for defensive programming.
| Method Summary | ||
|---|---|---|
static
|
cast(Object parameterValue,
Class<T> type,
String parameterName)
Checks that the provided value is not null, and may be cast to the desired type. |
|
static String |
notBlank(String value,
String parameterName)
Checks that a parameter value is not null and not empty. |
|
static
|
notNull(T value,
String parameterName)
Checks that a method parameter value is not null, and returns it. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T> T notNull(T value,
String parameterName)
T - the value typevalue - the value (which is checked to ensure non-nullness)parameterName - the name of the parameter, used for exception messages
IllegalArgumentException - if the value is null
public static String notBlank(String value,
String parameterName)
value - value to check (which is returned)parameterName - the name of the parameter, used for exception messages
IllegalArgumentException - if the value is null or empty
public static <T> T cast(Object parameterValue,
Class<T> type,
String parameterName)
T - parameterValue - type - parameterName -
IllegalArgumentException - if the value is null, or is not assignable to the indicated type
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||