public final class Require extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
condition(boolean condition,
String message,
Object... format)
Asserts that the given condition holds
true. |
static void |
nonNull(Object obj,
String paramName)
Asserts that the given object is non null.
|
static void |
nonNullResult(Object result,
String call)
Asserts that a method call yielded a non-null result.
|
static void |
state(boolean state,
String message,
Object... format)
Asserts that the given condition holds
true. |
public static void nonNull(Object obj, String paramName)
obj - The object to test.paramName - The name of the parameter (used for exception message).IllegalArgumentException - If obj is null.public static void condition(boolean condition,
String message,
Object... format)
true.condition - The condition to check.message - String for the exception message.format - Formatting parameters for the exception message.IllegalArgumentException - If condition is
false.public static void state(boolean state,
String message,
Object... format)
true.state - The condition to check.message - String for the exception message.format - Formatting parameters for the exception message.IllegalStateException - If condition is false.public static void nonNullResult(Object result, String call)
result - The result object.call - A String description of the call, like "Object.calledMethod".IllegalStateException - If result is null.Copyright © 2014–2015. All rights reserved.