Package org.ek9lang.core
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 void
checkCanReadFile
(String messageIfNoRead, File file) Check file not null valid and file can be read.static void
checkCanReadFile
(String messageIfNoRead, String fileName) Check filename valid and file can be read.static void
checkDirectoryReadable
(String messageIfNoRead, File dir) Check directory name valid and directory can be read.static void
checkDirectoryReadable
(String messageIfNoRead, String directoryName) Check directory name valid and directory can be read.static void
checkDirectoryWritable
(String messageIfNoWrite, File dir) Check directory name valid and directory can be written to.static void
checkDirectoryWritable
(String messageIfNoWrite, String directoryName) Check directory name valid and directory can be written to.static void
checkFalse
(String messageIfTrue, boolean value) Asserts that the value is false, illegal argument exception if not.static void
checkNotEmpty
(String messageIfEmpty, String valueToCheck) Checks if a string value is null or an empty string and if so issues an illegal argument exception.static void
checkNotEmpty
(String messageIfEmpty, String[] valuesToCheck) Checks if a string values is null or empty strings and if so issues an illegal argument exception.static void
checkNotEmpty
(String messageIfEmpty, Collection<?> items) Checks if a collection of items is null or empty and if so issues an illegal argument exception.static void
checkNotEmpty
(String messageIfEmpty, Optional<?> item) Check item not null and not empty.static void
checkNotNull
(String messageIfNull, Object valueToCheck) Not null of exception error.static void
checkRange
(String messageIfOutside, Integer valueToCheck, Integer min, Integer max) A check on range of value.static void
Assets that a value is true or illegal argument exception.static void
Just trigger a direct failure.
-
Method Details
-
checkRange
public static void checkRange(String messageIfOutside, Integer valueToCheck, Integer min, Integer max) A check on range of value. -
checkNotNull
Not null of exception error. -
checkCanReadFile
Check filename valid and file can be read. -
checkCanReadFile
Check file not null valid and file can be read. -
checkDirectoryReadable
Check directory name valid and directory can be read. -
checkDirectoryReadable
Check directory name valid and directory can be read. -
checkDirectoryWritable
Check directory name valid and directory can be written to. -
checkDirectoryWritable
Check directory name valid and directory can be written to. -
checkNotEmpty
Check item not null and not empty. -
checkNotEmpty
Checks if a string value is null or an empty string and if so issues an illegal argument exception.- Parameters:
valueToCheck
- The value to check.
-
checkNotEmpty
Checks if a string values is null or empty strings and if so issues an illegal argument exception.- Parameters:
valuesToCheck
- The values to check.
-
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.
-