|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.magnolia.module.rssaggregator.util.Assert
public final class Assert
Assertion utility class that assists in validating arguments. Useful for identifying programmer errors early and clearly at runtime.
Method Summary | |
---|---|
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
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 failsStringUtils.isEmpty(String)
public static void notNull(Object o, String message)
public 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 fails
IllegalArgumentException
- if expression is false
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |