public class Assert extends Object
Provides parameter checking assertion functionality.
Modifier and Type | Method and Description |
---|---|
static void |
assertCondition(boolean condition,
String message)
Throws an exception if the given precondition is not met.
|
static String |
assertNotEmpty(String parameterName,
String parameterValue)
Throws an exception if the given parameter value is null or empty.
|
static <T> T |
assertNotNull(String parameterName,
T parameterValue)
Throws an exception if the given parameter value is null.
|
public static <T> T assertNotNull(String parameterName, T parameterValue) throws IllegalArgumentException
Throws an exception if the given parameter value is null.
T
- the type of the parameterparameterName
- the name of the parameter to investigateparameterValue
- the parameter value to investigateIllegalArgumentException
- thrown if the parameter value is nullpublic static String assertNotEmpty(String parameterName, String parameterValue) throws IllegalArgumentException
Throws an exception if the given parameter value is null or empty.
parameterName
- the name of the parameter to investigateparameterValue
- the parameter value to investigateIllegalArgumentException
- thrown if the parameter value is null or emptypublic static void assertCondition(boolean condition, String message)
Throws an exception if the given precondition is not met.
condition
- the result of the precondition checkmessage
- the message to be shown if the precondition is not metRuntimeException
- thrown if the precondition is not metCopyright © 2010 - 2017 edorasware ag. All Rights Reserved.