Class Assert
java.lang.Object
com.datastax.astra.internal.utils.Assert
Syntaxic sugar for common validations.
- Author:
- Cedrick LUNVEN (@clunven)
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidValidates that the input string is not null and not empty.static voidCheck condition at start.static voidValidates that the input object is not null.
-
Method Details
-
hasLength
Validates that the input string is not null and not empty.This method is used to enforce preconditions on string parameters, ensuring they contain meaningful content before processing.
- Parameters:
s- the string value to validatename- the parameter name to include in the error message- Throws:
IllegalArgumentException- if the string is null or empty
-
notNull
Validates that the input object is not null.This method is used to enforce preconditions on object parameters, ensuring they are properly initialized before use.
- Parameters:
o- the object value to validatename- the parameter name to include in the error message- Throws:
IllegalArgumentException- if the object is null
-
isTrue
Check condition at start.- Parameters:
condition- predicate should be truemsg- error message
-