public final class Assert
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
hasText(java.lang.String text,
java.lang.String message)
Assert that the given String has valid text content; that is, it must not
be
null and must contain at least one non-whitespace character. |
static void |
isTrue(boolean expression,
java.lang.String message)
Assert a boolean expression, throwing
IllegalArgumentException
if the test result is false. |
static void |
notNull(java.lang.Object object,
java.lang.String message)
Assert that an object is not
null . |
public static void isTrue(boolean expression,
java.lang.String message)
IllegalArgumentException
if the test result is false.
Assert.isTrue(i > 0, "The value must be greater than zero");
expression - a boolean expressionmessage - the exception message to use if the assertion failsjava.lang.IllegalArgumentException - if expression is falsepublic static void notNull(java.lang.Object object,
java.lang.String message)
null .
Assert.notNull(clazz, "The class must not be null");
object - the object to checkmessage - the exception message to use if the assertion failsjava.lang.IllegalArgumentException - if the object is nullpublic static void hasText(java.lang.String text,
java.lang.String message)
null and must contain at least one non-whitespace character.
Assert.hasText(name, "'name' must not be empty");
text - the String to checkmessage - the exception message to use if the assertion failsStrings.hasText(java.lang.CharSequence)Copyright © 2019-2020 paseto.dev. All Rights Reserved.