public class ArgumentNotValid extends NetarkivetException
Constructor and Description |
---|
ArgumentNotValid(String message)
Constructs new ArgumentNotValid with the specified detail message.
|
ArgumentNotValid(String message,
Throwable cause)
Constructs new ArgumentNotValid with the specified detail message and cause.
|
Modifier and Type | Method and Description |
---|---|
static void |
checkExistsDirectory(File aDir,
String name)
Check, if the given argument is an existing directory.
|
static void |
checkExistsNormalFile(File aFile,
String name)
Check, if the given argument is an existing normal file.
|
static void |
checkNotNegative(int num,
String name)
Check if an int argument is less than 0.
|
static void |
checkNotNegative(long num,
String name)
Check if a long argument is less than 0.
|
static void |
checkNotNull(Object val,
String name)
Check if an Object argument is null.
|
static void |
checkNotNullOrEmpty(Collection<?> c,
String name)
Check if a List argument is not null and the list is not empty.
|
static void |
checkNotNullOrEmpty(String val,
String name)
Check if a String argument is null or the empty string.
|
static void |
checkPositive(int num,
String name)
Check if an int argument is less than or equal to 0.
|
static void |
checkPositive(long num,
String name)
Check if a long argument is less than 0.
|
static void |
checkTrue(boolean b,
String s)
Check that some condition on input parameters is true and throw an ArgumentNotValid if it is false.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public ArgumentNotValid(String message)
message
- The detail messagepublic ArgumentNotValid(String message, Throwable cause)
message
- The detail messagecause
- The causepublic static void checkNotNullOrEmpty(String val, String name)
val
- the value to checkname
- the name and type of the value being checkedArgumentNotValid
- if test failspublic static void checkNotNull(Object val, 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, String name)
num
- argument to checkname
- the name and type of the value being checked.ArgumentNotValid
- if test failspublic static void checkNotNegative(long num, String name)
num
- argument to checkname
- the name and type of the value being checked.ArgumentNotValid
- if test failspublic static void checkPositive(int num, String name)
num
- argument to checkname
- the name and type of the value being checked.ArgumentNotValid
- if test failspublic static void checkPositive(long num, String name)
num
- argument to checkname
- the name and type of the value being checked.ArgumentNotValid
- if test failspublic static void checkNotNullOrEmpty(Collection<?> c, String name)
c
- argument to checkname
- the name and type of the value being checked.ArgumentNotValid
- if test failspublic static void checkTrue(boolean b, String s)
b
- the condition to checks
- the error message to be reportedArgumentNotValid
- if b is falsepublic static void checkExistsDirectory(File aDir, String name)
aDir
- a given File object.name
- Name of objectArgumentNotValid
- If aDir is not an existing directorypublic static void checkExistsNormalFile(File aFile, String name)
aFile
- a given File object.name
- Name of objectArgumentNotValid
- If aDir is not an existing fileCopyright © 2005–2016 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.