public final class Validate extends Object
Modifier and Type | Method and Description |
---|---|
static void |
isTrue(boolean condition,
String message)
Validates that the supplied condition is true, and throws an IllegalArgumentException otherwise.
|
static void |
notEmpty(String aString,
String argumentName)
Validates that the supplied object is not null, and throws an IllegalArgumentException otherwise.
|
static void |
notNull(Object object,
String argumentName)
Validates that the supplied object is not null, and throws a NullPointerException otherwise.
|
public static void notNull(Object object, String argumentName)
object
- The object to validate for null
-ness.argumentName
- The argument name of the object to validate. If supplied (i.e. non-null
),
this value is used in composing a better exception message.public static void notEmpty(String aString, String argumentName)
aString
- The string to validate for emptyness.argumentName
- The argument name of the object to validate.
If supplied (i.e. non-null
), this value is used in composing
a better exception message.public static void isTrue(boolean condition, String message)
condition
- The condition to validate for truth.message
- The exception message used within the IllegalArgumentException if the condition is false.Copyright © 2005–2015 MojoHaus. All rights reserved.