Package com.avoka.tm.util
Class Contract
- java.lang.Object
-
- com.avoka.tm.util.Contract
-
public class Contract extends Object
Provides design by contract programming validation functions.
- Since:
- 5.0.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
isTrue(boolean value, String message)
Ensure the specified condition value is true, or throw an IllegalArgumentExcpetion if false.static void
notBlank(String paramValue, String paramName)
Validate specified parameter is not null, or blank throw a IllegalArgumentException if null or blank.static void
notNull(Object paramValue, String paramName)
Validate specified parameter is not null, throw a IllegalArgumentException if null.
-
-
-
Method Detail
-
isTrue
public static void isTrue(boolean value, String message)
Ensure the specified condition value is true, or throw an IllegalArgumentExcpetion if false.- Parameters:
value
- the conditional value to testmessage
- the IllegalArgumentException message if the conditional value is false
-
notNull
public static void notNull(Object paramValue, String paramName)
Validate specified parameter is not null, throw a IllegalArgumentException if null.- Parameters:
paramValue
- the parameter value to verify not nullparamName
- the parameter name
-
-