Class Assert
java.lang.Object
net.adoptopenjdk.icedteaweb.Assert
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringrequireNonBlank(String str, String argumentName) Checks that the specifiedstrblank, throwsIllegalArgumentExceptionwith a customized error message if it is.static <T> TrequireNonNull(T value, String argumentName) Checks that the specifiedvalueis null and throwsNullPointerExceptionwith a customized error message if it is.
-
Field Details
-
NOT_NULL_MSG_FORMAT
- See Also:
-
NOT_EMPTY_MSG_FORMAT
- See Also:
-
-
Constructor Details
-
Assert
private Assert()
-
-
Method Details
-
requireNonNull
Checks that the specifiedvalueis null and throwsNullPointerExceptionwith a customized error message if it is.- Type Parameters:
T- type of the value- Parameters:
value- the value to be checked.argumentName- the name of the argument to be used in the error message.- Returns:
- the
value.
-
requireNonBlank
Checks that the specifiedstrblank, throwsIllegalArgumentExceptionwith a customized error message if it is.- Parameters:
str- the value to be checked.argumentName- the name of the argument to be used in the error message.- Returns:
- the
str. - Throws:
NullPointerException- ifstris null.IllegalArgumentException- ifstris blank.- See Also:
-