Package adams.flow.maven.shared
Class Validate
- java.lang.Object
-
- adams.flow.maven.shared.Validate
-
public final class Validate extends Object
Simple argument validator, inspired by the commons-lang. Based on jaxb2-maven-plugin code.- Author:
- Lennart Jörelid
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
Method Detail
-
notNull
public static void notNull(Object object, String argumentName)
Validates that the supplied object is not null, and throws a NullPointerException otherwise.- Parameters:
object
- The object to validate fornull
-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.
-
notEmpty
public static void notEmpty(String aString, String argumentName)
Validates that the supplied object is not null, and throws an IllegalArgumentException otherwise.- Parameters:
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.
-
-