public final class Assert extends Object
Modifier and Type | Method and Description |
---|---|
static void |
isTrue(boolean expression,
String message)
Assert a boolean expression, throwing
IllegalArgumentException if the test result is
false . |
static void |
notBlank(String s,
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 |
notNull(Object o,
String message) |
public static void notBlank(String s, String message)
null
and must contain
at least one non-whitespace character.
Assert.hasText(name, "'name' must not be empty");
s
- the String to checkmessage
- the exception message to use if the assertion failspublic static void isTrue(boolean expression, String message)
IllegalArgumentException
if the test result is
false
.expression
- a boolean expressionmessage
- the exception message to use if the assertion failsIllegalArgumentException
- if expression is false
Copyright © 2016 Magnolia International Ltd.. All rights reserved.