public abstract class Assert extends Object
Modifier and Type | Method and Description |
---|---|
static void |
isTrue(boolean condition,
String message)
Throws an exception if the given precondition is not met.
|
static void |
notNull(String valueName,
Object value)
Throws an exception if the given value is null.
|
static String |
parameterNotEmpty(String parameterName,
String parameterValue)
Throws an exception if the given parameter value is null or empty.
|
static <T> T |
parameterNotNull(String parameterName,
T parameterValue)
Throws an exception if the given parameter value is null.
|
static String |
propertyNotEmpty(String propertyName,
String propertyValue)
Throws an exception if the given property value is null or empty.
|
static <T> T |
propertyNotNull(String propertyName,
T propertyValue)
Throws an exception if the given property value is null.
|
public static <T> T parameterNotNull(String parameterName, T parameterValue) throws IllegalArgumentException
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 parameterNotEmpty(String parameterName, String parameterValue) throws IllegalArgumentException
parameterName
- the name of the parameter to investigateparameterValue
- the parameter value to investigateIllegalArgumentException
- thrown if the parameter value is null or emptypublic static <T> T propertyNotNull(String propertyName, T propertyValue) throws IllegalArgumentException
T
- the type of the propertypropertyName
- the name of the property to investigatepropertyValue
- the property value to investigateIllegalArgumentException
- thrown if the property value is nullpublic static String propertyNotEmpty(String propertyName, String propertyValue) throws IllegalArgumentException
propertyName
- the name of the property to investigatepropertyValue
- the property value to investigateIllegalArgumentException
- thrown if the property value is null or emptypublic static void notNull(String valueName, Object value) throws IllegalArgumentException
valueName
- the name of the value to investigatevalue
- the value to investigateAssertionError
- thrown if the value is nullIllegalArgumentException
public static void isTrue(boolean condition, String message)
condition
- the result of the precondition checkmessage
- the message to be shown if the precondition is not metAssertionError
- thrown if the precondition is not metCopyright © 2010 - 2018 edorasware ag. All Rights Reserved.