|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
dk.netarkivet.common.exceptions.NetarkivetException
dk.netarkivet.common.exceptions.ArgumentNotValid
public class ArgumentNotValid
Indicates that one or more arguments are invalid.
Constructor Summary | |
---|---|
ArgumentNotValid(java.lang.String message)
Constructs new ArgumentNotValid with the specified detail message. |
|
ArgumentNotValid(java.lang.String message,
java.lang.Throwable cause)
Constructs new ArgumentNotValid with the specified detail message and cause. |
Method Summary | |
---|---|
static void |
checkNotNegative(int num,
java.lang.String name)
Check if an int argument is less than 0. |
static void |
checkNotNegative(long num,
java.lang.String name)
Check if a long argument is less than 0. |
static void |
checkNotNull(java.lang.Object val,
java.lang.String name)
Check if an Object argument is null. |
static void |
checkNotNullOrEmpty(java.util.Collection<?> c,
java.lang.String name)
Check if a List argument is not null and the list is not empty. |
static void |
checkNotNullOrEmpty(java.lang.String val,
java.lang.String name)
Check if a String argument is null or the empty string. |
static void |
checkPositive(int num,
java.lang.String name)
Check if an int argument is less than or equal to 0. |
static void |
checkPositive(long num,
java.lang.String name)
Check if a long argument is less than 0. |
static void |
checkTrue(boolean b,
java.lang.String s)
Check that some condition on input parameters is true and throw an ArgumentNotValid if it is false. |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ArgumentNotValid(java.lang.String message)
message
- The detail messagepublic ArgumentNotValid(java.lang.String message, java.lang.Throwable cause)
message
- The detail messagecause
- The causeMethod Detail |
---|
public static void checkNotNullOrEmpty(java.lang.String val, java.lang.String name)
val
- the value to checkname
- the name and type of the value being checked
ArgumentNotValid
- if test failspublic static void checkNotNull(java.lang.Object val, java.lang.String name)
val
- the value to checkname
- the name and type of the value being checked.
ArgumentNotValid
- if test failspublic static void checkNotNegative(int num, java.lang.String name)
num
- argument to checkname
- the name and type of the value being checked.
ArgumentNotValid
- if test failspublic static void checkNotNegative(long num, java.lang.String name)
num
- argument to checkname
- the name and type of the value being checked.
ArgumentNotValid
- if test failspublic static void checkPositive(int num, java.lang.String name)
num
- argument to checkname
- the name and type of the value being checked.
ArgumentNotValid
- if test failspublic static void checkPositive(long num, java.lang.String name)
num
- argument to checkname
- the name and type of the value being checked.
ArgumentNotValid
- if test failspublic static void checkNotNullOrEmpty(java.util.Collection<?> c, java.lang.String name)
c
- argument to checkname
- the name and type of the value being checked.
ArgumentNotValid
- if test failspublic static void checkTrue(boolean b, java.lang.String s)
b
- the condition to checks
- the error message to be reported
ArgumentNotValid
- if b is false
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |