Package com.webauthn4j.util
Class AssertUtil
java.lang.Object
com.webauthn4j.util.AssertUtil
Assertion utility class that assists in validating arguments.
Members are copied from org.springframework.util.Assert class
Original Assert class authors: Keith Donald Juergen Hoeller Sam Brannen Colin Sampaleanu Rob Harrop
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
static void
Assert that an array contains elements; that is, it must not benull
and must contain at least one element.static void
notEmpty
(@Nullable Collection<?> collection, @NonNull String message) Assert that a collection contains elements; that is, it must not benull
and must contain at least one element.static void
Assert that an object is notnull
.
-
Method Details
-
notNull
Assert that an object is notnull
.Assert.notNull(clazz, "The class must not be null");
- Parameters:
object
- the object to checkmessage
- the exception message to use if the assertion fails- Throws:
IllegalArgumentException
- if the object isnull
-
notEmpty
Assert that an array contains elements; that is, it must not benull
and must contain at least one element.Assert.notEmpty(array, "The array must contain elements");
- Parameters:
array
- the array to checkmessage
- the exception message to use if the assertion fails- Throws:
IllegalArgumentException
- if the object array isnull
or contains no elements
-
notEmpty
Assert that a collection contains elements; that is, it must not benull
and must contain at least one element.Assert.notEmpty(collection, "Collection must contain elements");
- Parameters:
collection
- the collection to checkmessage
- the exception message to use if the assertion fails- Throws:
IllegalArgumentException
- if the collection isnull
or contains no elements
-
isTrue
-