Class AssertValue
java.lang.Object
org.ek9lang.core.AssertValue
Used as simple one-liners to check a value and issue an illegal argument exception if empty.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckCanReadFile(String messageIfNoRead, File file) Check file not null valid and file can be read.static voidcheckCanReadFile(String messageIfNoRead, String fileName) Check filename valid and file can be read.static voidcheckDirectoryReadable(String messageIfNoRead, File dir) Check directory name valid and directory can be read.static voidcheckDirectoryReadable(String messageIfNoRead, String directoryName) Check directory name valid and directory can be read.static voidcheckDirectoryWritable(String messageIfNoWrite, File dir) Check directory name valid and directory can be written to.static voidcheckDirectoryWritable(String messageIfNoWrite, String directoryName) Check directory name valid and directory can be written to.static voidcheckFalse(String messageIfTrue, boolean value) Asserts that the value is false, illegal argument exception if not.static voidcheckNotEmpty(String messageIfEmpty, String valueToCheck) Checks if a string value is null or an empty string and if so issues an illegal argument exception.static voidcheckNotEmpty(String messageIfEmpty, String[] valuesToCheck) Checks if a string values is null or empty strings and if so issues an illegal argument exception.static voidcheckNotEmpty(String messageIfEmpty, Collection<?> items) Checks if a collection of items is null or empty and if so issues an illegal argument exception.static voidcheckNotEmpty(String messageIfEmpty, Optional<?> item) Check item not null and not empty.static voidcheckNotNull(String messageIfNull, Object valueToCheck) Not null of exception error.static voidcheckRange(String messageIfOutside, Integer valueToCheck, Integer min, Integer max) A check on range of value.static voidAssets that a value is true or illegal argument exception.static voidJust trigger a direct failure.
-
Method Details
-
checkRange
-
checkNotNull
-
checkCanReadFile
-
checkCanReadFile
-
checkDirectoryReadable
-
checkDirectoryReadable
-
checkDirectoryWritable
-
checkDirectoryWritable
-
checkNotEmpty
-
checkNotEmpty
-
checkNotEmpty
-
checkNotEmpty
Checks if a collection of items is null or empty and if so issues an illegal argument exception.- Parameters:
items- The values to check.
-
checkTrue
Assets that a value is true or illegal argument exception. -
checkFalse
Asserts that the value is false, illegal argument exception if not. -
fail
Just trigger a direct failure.- Parameters:
withMessage- The message to issue.
-