public final class Condition
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
ensureAtLeast(double value,
double referenceValue,
java.lang.String exceptionMessage)
Ensures, that a
Double value is at least as great as a reference value. |
static void |
ensureAtLeast(double value,
double referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that a
Double value is at least as great as a reference value. |
static void |
ensureAtLeast(float value,
float referenceValue,
java.lang.String exceptionMessage)
Ensures, that a
Float value is at least as great as a reference value. |
static void |
ensureAtLeast(float value,
float referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that a
Float value is at least as great as a reference value. |
static void |
ensureAtLeast(int value,
int referenceValue,
java.lang.String exceptionMessage)
Ensures, that an
Integer value is at least as great as a reference value. |
static void |
ensureAtLeast(int value,
int referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that an
Integer value is at least as great as a reference value. |
static void |
ensureAtLeast(long value,
long referenceValue,
java.lang.String exceptionMessage)
Ensures, that a
Long value is at least as great as a reference value. |
static void |
ensureAtLeast(long value,
long referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that a
Long value is at least as great as a reference value. |
static void |
ensureAtLeast(short value,
short referenceValue,
java.lang.String exceptionMessage)
Ensures, that a
Short value is at least as great as a reference value. |
static void |
ensureAtLeast(short value,
short referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that a
Short value is at least as great as a reference value. |
static void |
ensureAtMaximum(double value,
double referenceValue,
java.lang.String exceptionMessage)
Ensures, that a
Double value is at maximum as great as a reference value. |
static void |
ensureAtMaximum(double value,
double referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that a
Double value is at maximum as great as a reference value. |
static void |
ensureAtMaximum(float value,
float referenceValue,
java.lang.String exceptionMessage)
Ensures, that a
Float value is at maximum as great as a reference value. |
static void |
ensureAtMaximum(float value,
float referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that a
Float value is at maximum as great as a reference value. |
static void |
ensureAtMaximum(int value,
int referenceValue,
java.lang.String exceptionMessage)
Ensures, that an
Integer value is at maximum as great as a reference value. |
static void |
ensureAtMaximum(int value,
int referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that an
Integer value is at maximum as great as a reference value. |
static void |
ensureAtMaximum(long value,
long referenceValue,
java.lang.String exceptionMessage)
Ensures, that a
Long value is at maximum as great as a reference value. |
static void |
ensureAtMaximum(long value,
long referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that a
Long value is at maximum as great as a reference value. |
static void |
ensureAtMaximum(short value,
short referenceValue,
java.lang.String exceptionMessage)
Ensures, that a
Short value is at maximum as great as a reference value. |
static void |
ensureAtMaximum(short value,
short referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that a
Short value is at maximum as great as a reference value. |
static void |
ensureEqual(java.lang.Object object1,
java.lang.Object object2,
java.lang.String exceptionMessage)
Ensures, that two objects are equal.
|
static void |
ensureEqual(java.lang.Object object1,
java.lang.Object object2,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that two objects are equal.
|
static void |
ensureFalse(boolean expression,
java.lang.String exceptionMessage)
Ensures, that a specific boolean expression is false.
|
static void |
ensureFalse(boolean expression,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that a specific boolean expression is false.
|
static void |
ensureFileExists(java.io.File file,
java.lang.String exceptionMessage)
Ensures, that a specific file exists.
|
static void |
ensureFileExists(java.io.File file,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that a specific file exists.
|
static void |
ensureFileIsDirectory(java.io.File file,
java.lang.String exceptionMessage)
Ensures, that a specific file is a directory.
|
static void |
ensureFileIsDirectory(java.io.File file,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that a specific file is a directory.
|
static void |
ensureFileIsNoDirectory(java.io.File file,
java.lang.String exceptionMessage)
Ensures, that a specific file does exist and is not a directory.
|
static void |
ensureFileIsNoDirectory(java.io.File file,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that a specific file does exist and is not a directory.
|
static void |
ensureGreater(double value,
double referenceValue,
java.lang.String exceptionMessage)
Ensures, that a
Double value is greater as a reference value. |
static void |
ensureGreater(double value,
double referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that a
Double value is greater as a reference value. |
static void |
ensureGreater(float value,
float referenceValue,
java.lang.String exceptionMessage)
Ensures, that a
Float value is greater as a reference value. |
static void |
ensureGreater(float value,
float referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that a
Float value is greater as a reference value. |
static void |
ensureGreater(int value,
int referenceValue,
java.lang.String exceptionMessage)
Ensures, that an
Integer value is greater as a reference value. |
static void |
ensureGreater(int value,
int referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that an
Integer value is greater as a reference value. |
static void |
ensureGreater(long value,
long referenceValue,
java.lang.String exceptionMessage)
Ensures, that a
Long value is greater as a reference value. |
static void |
ensureGreater(long value,
long referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that a
Long value is greater as a reference value. |
static void |
ensureGreater(short value,
short referenceValue,
java.lang.String exceptionMessage)
Ensures, that a
Short value is greater as a reference value. |
static void |
ensureGreater(short value,
short referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that a
Short value is greater as a reference value. |
static void |
ensureNotEmpty(java.lang.CharSequence text,
java.lang.String exceptionMessage)
Ensures, that a text is not empty.
|
static void |
ensureNotEmpty(java.lang.CharSequence text,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that a text is not empty.
|
static void |
ensureNotEmpty(java.lang.Iterable<?> iterable,
java.lang.String exceptionMessage)
Ensures, that a
Iterable is not empty. |
static void |
ensureNotEmpty(java.lang.Iterable<?> iterable,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that a
Iterable is not empty. |
static void |
ensureNotEqual(java.lang.Object object1,
java.lang.Object object2,
java.lang.String exceptionMessage)
Ensures, that two objects are not equal.
|
static void |
ensureNotEqual(java.lang.Object object1,
java.lang.Object object2,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that two objects are not equal.
|
static void |
ensureNotNull(java.lang.Object object,
java.lang.String exceptionMessage)
Ensures that an object is not null.
|
static void |
ensureNotNull(java.lang.Object object,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures that an object is not null.
|
static void |
ensureSmaller(double value,
double referenceValue,
java.lang.String exceptionMessage)
Ensures, that a
Double value is smaller as a reference value. |
static void |
ensureSmaller(double value,
double referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that a
Double value is smaller as a reference value. |
static void |
ensureSmaller(float value,
float referenceValue,
java.lang.String exceptionMessage)
Ensures, that a
Float value is smaller as a reference value. |
static void |
ensureSmaller(float value,
float referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that a
Float value is smaller as a reference value. |
static void |
ensureSmaller(int value,
int referenceValue,
java.lang.String exceptionMessage)
Ensures, that an
Integer value is smaller as a reference value. |
static void |
ensureSmaller(int value,
int referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that an
Integer value is smaller as a reference value. |
static void |
ensureSmaller(long value,
long referenceValue,
java.lang.String exceptionMessage)
Ensures, that a
Long value is smaller as a reference value. |
static void |
ensureSmaller(long value,
long referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that a
Long value is smaller as a reference value. |
static void |
ensureSmaller(short value,
short referenceValue,
java.lang.String exceptionMessage)
Ensures, that a
Short value is smaller as a reference value. |
static void |
ensureSmaller(short value,
short referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that a
Short value is smaller as a reference value. |
static void |
ensureTrue(boolean expression,
java.lang.String exceptionMessage)
Ensures, that a specific boolean expression is true.
|
static void |
ensureTrue(boolean expression,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Ensures, that a specific boolean expression is true.
|
public static void ensureTrue(boolean expression,
java.lang.String exceptionMessage)
IllegalArgumentException is thrown.expression - The boolean expression, which should be checked, as a Boolean valueexceptionMessage - The message of the exception, which is thrown, if the given boolean expression is not
true, as a String or null, if the exception should not have a messagepublic static void ensureTrue(boolean expression,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
RuntimeException is thrown.expression - The boolean expression, which should be checked, as a Boolean valueexceptionMessage - The message of the exception, which is thrown, if the given boolean expression is not
true, as a String or null, if the exception should not have a messageexceptionClass - The class of the runtime exception, which should be thrown, if the given boolean
expression is not true, as an instance of the class Class. The class may not
be nullpublic static void ensureFalse(boolean expression,
java.lang.String exceptionMessage)
IllegalArgumentException is thrown.expression - The boolean expression, which should be checked, as a Boolean valueexceptionMessage - The message of the exception, which is thrown, if the given boolean expression is not
false, as a String or null, if the exception should not have a messagepublic static void ensureFalse(boolean expression,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
RuntimeException is thrown.expression - The boolean expression, which should be checked, as a Boolean valueexceptionMessage - The message of the exception, which is thrown, if the given boolean expression is not
false, as a String or null, if the exception should not have a messageexceptionClass - The class of the runtime exception, which should be thrown, if the given boolean
expression is not false, as an instance of the class Class. The class may not
be nullpublic static void ensureEqual(java.lang.Object object1,
java.lang.Object object2,
java.lang.String exceptionMessage)
IllegalArgumentException is
thrown.object1 - The first object as an instance of the class Objectobject2 - The second object as an instance of the class ObjectexceptionMessage - The message of the exception, which is thrown, if the given objects are not equal, as
a String or null, if the exception should not have a messagepublic static void ensureEqual(java.lang.Object object1,
java.lang.Object object2,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
RuntimeException is
thrown.object1 - The first object as an instance of the class Objectobject2 - The second object as an instance of the class ObjectexceptionMessage - The message of the exception, which is thrown, if the given objects are not equal, as
a String or null, if the exception should not have a messageexceptionClass - The class of the runtime exception, which should be thrown, if the objects are not
equal, as an instance of the class Class. The class may not be nullpublic static void ensureNotEqual(java.lang.Object object1,
java.lang.Object object2,
java.lang.String exceptionMessage)
IllegalArgumentException is
thrown.object1 - The first object as an instance of the class Objectobject2 - The second object as an instance of the class ObjectexceptionMessage - The message of the exception, which is thrown, if the given objects are equal, as a
String or null, if the exception should not have a messagepublic static void ensureNotEqual(java.lang.Object object1,
java.lang.Object object2,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
RuntimeException is
thrown.object1 - The first object as an instance of the class Objectobject2 - The second object as an instance of the class ObjectexceptionMessage - The message of the exception, which is thrown, if the given objects are equal, as a
String or null, if the exception should not have a messageexceptionClass - The class of the runtime exception, which should be thrown, if the objects are equal,
as an instance of the class Class. The class may not be nullpublic static void ensureNotNull(java.lang.Object object,
java.lang.String exceptionMessage)
NullPointerException with a specific
message is thrown.object - The object, which should be checked, as an instance of the class ObjectexceptionMessage - The message of the exception, which is thrown, if the given object is null, as a
String or null, if the exception should not have a messagepublic static void ensureNotNull(java.lang.Object object,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
RuntimeException is thrown.object - The object, which should be checked, as an instance of the class ObjectexceptionMessage - The message of the exception, which is thrown, if the given object is null, as a
String or null, if the exception should not have a messageexceptionClass - The class of the runtime exception, which should be thrown, if the given object is
null, as an instance of the class Class. The class may not be nullpublic static void ensureNotEmpty(java.lang.CharSequence text,
java.lang.String exceptionMessage)
IllegalArgumentException with a
specific message is thrown.text - The text, which should be checked, as an instance of the type CharSequenceexceptionMessage - The message of the exception, which is thrown, if the given text is empty, as a
String or null, if the exception should not have a messagepublic static void ensureNotEmpty(java.lang.CharSequence text,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
RuntimeException is thrown.text - The text, which should be checked, as an instance of the type CharSequenceexceptionMessage - The message of the exception, which is thrown, if the given text is empty, as a
String or null, if the exception should not have a messageexceptionClass - The class of the runtime exception, which should be thrown, if the given text is
empty, as an instance of the class Class. The class may not be nullpublic static void ensureAtLeast(short value,
short referenceValue,
java.lang.String exceptionMessage)
Short value is at least as great as a reference value. Otherwise an
IllegalArgumentException with a specific message is thrown.value - The value, which should be checked, as a Short valuereferenceValue - The reference value, the given value must be at least as great as, as a Short
valueexceptionMessage - The message of the exception, which is thrown, if the given value is smaller as the
reference value, as a String or null, if the exception should not have a
messagepublic static void ensureAtLeast(short value,
short referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Short value is at least as great as a reference value. Otherwise a
specific RuntimeException is thrown.value - The value, which should be checked, as a Short valuereferenceValue - The reference value, the given value must be at least as great as, as a Short
valueexceptionMessage - The message of the exception, which is thrown, if the given value is smaller as the
reference value, as a String or null, if the exception should not have a
messageexceptionClass - The class of the runtime exception, which should be thrown, if the given value is
smaller as the reference value, as an instance of the class Class. The class
may not be nullpublic static void ensureAtLeast(int value,
int referenceValue,
java.lang.String exceptionMessage)
Integer value is at least as great as a reference value. Otherwise
an IllegalArgumentException with a specific message is thrown.value - The value, which should be checked, as an Integer valuereferenceValue - The reference value, the given value must be at least as great as, as an Integer valueexceptionMessage - The message of the exception, which is thrown, if the given value is smaller as the
reference value, as a String or null, if the exception should not have a
messagepublic static void ensureAtLeast(int value,
int referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Integer value is at least as great as a reference value. Otherwise a
specific RuntimeException is thrown.value - The value, which should be checked, as an Integer valuereferenceValue - The reference value, the given value must be at least as great as, as an Integer valueexceptionMessage - The message of the exception, which is thrown, if the given value is smaller as the
reference value, as a String or null, if the exception should not have a
messageexceptionClass - The class of the runtime exception, which should be thrown, if the given value is
smaller as the reference value, as an instance of the class Class. The class
may not be nullpublic static void ensureAtLeast(long value,
long referenceValue,
java.lang.String exceptionMessage)
Long value is at least as great as a reference value. Otherwise an
IllegalArgumentException with a specific message is thrown.value - The value, which should be checked, as a Long valuereferenceValue - The reference value, the given value must be at least as great as, as a Long
valueexceptionMessage - The message of the exception, which is thrown, if the given value is smaller as the
reference value, as a String or null, if the exception should not have a
messagepublic static void ensureAtLeast(long value,
long referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Long value is at least as great as a reference value. Otherwise a
specific RuntimeException is thrown.value - The value, which should be checked, as a Long valuereferenceValue - The reference value, the given value must be at least as great as, as a Long
valueexceptionMessage - The message of the exception, which is thrown, if the given value is smaller as the
reference value, as a String or null, if the exception should not have a
messageexceptionClass - The class of the runtime exception, which should be thrown, if the given value is
smaller as the reference value, as an instance of the class Class. The class
may not be nullpublic static void ensureAtLeast(float value,
float referenceValue,
java.lang.String exceptionMessage)
Float value is at least as great as a reference value. Otherwise an
IllegalArgumentException with a specific message is thrown.value - The value, which should be checked, as a Float valuereferenceValue - The reference value, the given value must be at least as great as, as a Float
valueexceptionMessage - The message of the exception, which is thrown, if the given value is smaller as the
reference value, as a String or null, if the exception should not have a
messagepublic static void ensureAtLeast(float value,
float referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Float value is at least as great as a reference value. Otherwise a
specific RuntimeException is thrown.value - The value, which should be checked, as a Float valuereferenceValue - The reference value, the given value must be at least as great as, as a Float
valueexceptionMessage - The message of the exception, which is thrown, if the given value is smaller as the
reference value, as a String or null, if the exception should not have a
messageexceptionClass - The class of the runtime exception, which should be thrown, if the given value is
smaller as the reference value, as an instance of the class Class. The class
may not be nullpublic static void ensureAtLeast(double value,
double referenceValue,
java.lang.String exceptionMessage)
Double value is at least as great as a reference value. Otherwise an
IllegalArgumentException with a specific message is thrown.value - The value, which should be checked, as a Double valuereferenceValue - The reference value, the given value must be at least as great as, as a Double valueexceptionMessage - The message of the exception, which is thrown, if the given value is smaller as the
reference value, as a String or null, if the exception should not have a
messagepublic static void ensureAtLeast(double value,
double referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Double value is at least as great as a reference value. Otherwise a
specific RuntimeException is thrown.value - The value, which should be checked, as a Double valuereferenceValue - The reference value, the given value must be at least as great as, as a Double valueexceptionMessage - The message of the exception, which is thrown, if the given value is smaller as the
reference value, as a String or null, if the exception should not have a
messageexceptionClass - The class of the runtime exception, which should be thrown, if the given value is
smaller as the reference value, as an instance of the class Class. The class
may not be nullpublic static void ensureAtMaximum(short value,
short referenceValue,
java.lang.String exceptionMessage)
Short value is at maximum as great as a reference value. Otherwise an
IllegalArgumentException with a specific message is thrown.value - The value, which should be checked, as a Short valuereferenceValue - The reference value, the given value must be at maximum as great as, as a Short valueexceptionMessage - The message of the exception, which is thrown, if the given value is greater as the
reference value, as a String or null, if the exception should not have a
messagepublic static void ensureAtMaximum(short value,
short referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Short value is at maximum as great as a reference value. Otherwise a
specific RuntimeException is thrown.value - The value, which should be checked, as a Short valuereferenceValue - The reference value, the given value must be at maximum as great as, as a Short valueexceptionMessage - The message of the exception, which is thrown, if the given value is greater as the
reference value, as a String or null, if the exception should not have a
messageexceptionClass - The class of the runtime exception, which should be thrown, if the given value is
greater as the reference value, as an instance of the class Class. The class
may not be nullpublic static void ensureAtMaximum(int value,
int referenceValue,
java.lang.String exceptionMessage)
Integer value is at maximum as great as a reference value. Otherwise
an IllegalArgumentException with a specific message is thrown.value - The value, which should be checked, as an Integer valuereferenceValue - The reference value, the given value must be at maximum as great as, as an Integer valueexceptionMessage - The message of the exception, which is thrown, if the given value is greater as the
reference value, as a String or null, if the exception should not have a
messagepublic static void ensureAtMaximum(int value,
int referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Integer value is at maximum as great as a reference value. Otherwise
a specific RuntimeException is thrown.value - The value, which should be checked, as an Integer valuereferenceValue - The reference value, the given value must be at maximum as great as, as a Short valueexceptionMessage - The message of the exception, which is thrown, if the given value is greater as the
reference value, as a String or null, if the exception should not have a
messageexceptionClass - The class of the runtime exception, which should be thrown, if the given value is
greater as the reference value, as an instance of the class Class. The class
may not be nullpublic static void ensureAtMaximum(long value,
long referenceValue,
java.lang.String exceptionMessage)
Long value is at maximum as great as a reference value. Otherwise an
IllegalArgumentException with a specific message is thrown.value - The value, which should be checked, as a Long valuereferenceValue - The reference value, the given value must be at maximum as great as, as a Long valueexceptionMessage - The message of the exception, which is thrown, if the given value is greater as the
reference value, as a String or null, if the exception should not have a
messagepublic static void ensureAtMaximum(long value,
long referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Long value is at maximum as great as a reference value. Otherwise a
specific RuntimeException is thrown.value - The value, which should be checked, as a Long valuereferenceValue - The reference value, the given value must be at maximum as great as, as a Long valueexceptionMessage - The message of the exception, which is thrown, if the given value is greater as the
reference value, as a String or null, if the exception should not have a
messageexceptionClass - The class of the runtime exception, which should be thrown, if the given value is
greater as the reference value, as an instance of the class Class. The class
may not be nullpublic static void ensureAtMaximum(float value,
float referenceValue,
java.lang.String exceptionMessage)
Float value is at maximum as great as a reference value. Otherwise an
IllegalArgumentException with a specific message is thrown.value - The value, which should be checked, as a Float valuereferenceValue - The reference value, the given value must be at maximum as great as, as a Float valueexceptionMessage - The message of the exception, which is thrown, if the given value is greater as the
reference value, as a String or null, if the exception should not have a
messagepublic static void ensureAtMaximum(float value,
float referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Float value is at maximum as great as a reference value. Otherwise a
specific RuntimeException is thrown.value - The value, which should be checked, as a Float valuereferenceValue - The reference value, the given value must be at maximum as great as, as a Float valueexceptionMessage - The message of the exception, which is thrown, if the given value is greater as the
reference value, as a String or null, if the exception should not have a
messageexceptionClass - The class of the runtime exception, which should be thrown, if the given value is
greater as the reference value, as an instance of the class Class. The class
may not be nullpublic static void ensureAtMaximum(double value,
double referenceValue,
java.lang.String exceptionMessage)
Double value is at maximum as great as a reference value. Otherwise
an IllegalArgumentException with a specific message is thrown.value - The value, which should be checked, as a Double valuereferenceValue - The reference value, the given value must be at maximum as great as, as a Double valueexceptionMessage - The message of the exception, which is thrown, if the given value is greater as the
reference value, as a String or null, if the exception should not have a
messagepublic static void ensureAtMaximum(double value,
double referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Double value is at maximum as great as a reference value. Otherwise a
specific RuntimeException is thrown.value - The value, which should be checked, as a Double valuereferenceValue - The reference value, the given value must be at maximum as great as, as a Double valueexceptionMessage - The message of the exception, which is thrown, if the given value is greater as the
reference value, as a String or null, if the exception should not have a
messageexceptionClass - The class of the runtime exception, which should be thrown, if the given value is
greater as the reference value, as an instance of the class Class. The class
may not be nullpublic static void ensureGreater(short value,
short referenceValue,
java.lang.String exceptionMessage)
Short value is greater as a reference value. Otherwise an IllegalArgumentException with a specific message is thrown.value - The value, which should be checked, as a Short valuereferenceValue - The reference value, the given value must be greater as, as a Short valueexceptionMessage - The message of the exception, which is thrown, if the given value is smaller or equal
as the reference value, as a String or null, if the exception should not have
a messagepublic static void ensureGreater(short value,
short referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Short value is greater as a reference value. Otherwise a specific
RuntimeException is thrown.value - The value, which should be checked, as a Short valuereferenceValue - The reference value, the given value must be greater as, as a Short valueexceptionMessage - The message of the exception, which is thrown, if the given value is smaller or equal
as the reference value, as a String or null, if the exception should not have
a messageexceptionClass - The class of the runtime exception, which should be thrown, if the given value is
smaller or equal as the reference value, as an instance of the class Class.
The class may not be nullpublic static void ensureGreater(int value,
int referenceValue,
java.lang.String exceptionMessage)
Integer value is greater as a reference value. Otherwise an IllegalArgumentException with a specific message is thrown.value - The value, which should be checked, as an Integer valuereferenceValue - The reference value, the given value must be greater as, as an Integer valueexceptionMessage - The message of the exception, which is thrown, if the given value is smaller or equal
as the reference value, as a String or null, if the exception should not have
a messagepublic static void ensureGreater(int value,
int referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Integer value is greater as a reference value. Otherwise a specific
RuntimeException is thrown.value - The value, which should be checked, as an Integer valuereferenceValue - The reference value, the given value must be greater as, as an Integer valueexceptionMessage - The message of the exception, which is thrown, if the given value is smaller or equal
as the reference value, as a String or null, if the exception should not have
a messageexceptionClass - The class of the runtime exception, which should be thrown, if the given value is
smaller or equal as the reference value, as an instance of the class Class.
The class may not be nullpublic static void ensureGreater(long value,
long referenceValue,
java.lang.String exceptionMessage)
Long value is greater as a reference value. Otherwise an IllegalArgumentException with a specific message is thrown.value - The value, which should be checked, as a Long valuereferenceValue - The reference value, the given value must be greater as, as a Long valueexceptionMessage - The message of the exception, which is thrown, if the given value is smaller or equal
as the reference value, as a String or null, if the exception should not have
a messagepublic static void ensureGreater(long value,
long referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Long value is greater as a reference value. Otherwise a specific
RuntimeException is thrown.value - The value, which should be checked, as a Long valuereferenceValue - The reference value, the given value must be greater as, as a Long valueexceptionMessage - The message of the exception, which is thrown, if the given value is smaller or equal
as the reference value, as a String or null, if the exception should not have
a messageexceptionClass - The class of the runtime exception, which should be thrown, if the given value is
smaller or equal as the reference value, as an instance of the class Class.
The class may not be nullpublic static void ensureGreater(float value,
float referenceValue,
java.lang.String exceptionMessage)
Float value is greater as a reference value. Otherwise an IllegalArgumentException with a specific message is thrown.value - The value, which should be checked, as a Float valuereferenceValue - The reference value, the given value must be greater as, as a Float valueexceptionMessage - The message of the exception, which is thrown, if the given value is smaller or equal
as the reference value, as a String or null, if the exception should not have
a messagepublic static void ensureGreater(float value,
float referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Float value is greater as a reference value. Otherwise a specific
RuntimeException is thrown.value - The value, which should be checked, as a Float valuereferenceValue - The reference value, the given value must be greater as, as a Float valueexceptionMessage - The message of the exception, which is thrown, if the given value is smaller or equal
as the reference value, as a String or null, if the exception should not have
a messageexceptionClass - The class of the runtime exception, which should be thrown, if the given value is
smaller or equal as the reference value, as an instance of the class Class.
The class may not be nullpublic static void ensureGreater(double value,
double referenceValue,
java.lang.String exceptionMessage)
Double value is greater as a reference value. Otherwise an IllegalArgumentException with a specific message is thrown.value - The value, which should be checked, as a Double valuereferenceValue - The reference value, the given value must be greater as, as a Double valueexceptionMessage - The message of the exception, which is thrown, if the given value is smaller or equal
as the reference value, as a String or null, if the exception should not have
a messagepublic static void ensureGreater(double value,
double referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Double value is greater as a reference value. Otherwise a specific
RuntimeException is thrown.value - The value, which should be checked, as a Double valuereferenceValue - The reference value, the given value must be greater as, as a Double valueexceptionMessage - The message of the exception, which is thrown, if the given value is smaller or equal
as the reference value, as a String or null, if the exception should not have
a messageexceptionClass - The class of the runtime exception, which should be thrown, if the given value is
smaller or equal as the reference value, as an instance of the class Class.
The class may not be nullpublic static void ensureSmaller(short value,
short referenceValue,
java.lang.String exceptionMessage)
Short value is smaller as a reference value. Otherwise an IllegalArgumentException with a specific message is thrown.value - The value, which should be checked, as a Short valuereferenceValue - The reference value, the given value must be smaller as, as a Short valueexceptionMessage - The message of the exception, which is thrown, if the given value is greater or equal
as the reference value, as a String or null, if the exception should not have
a messagepublic static void ensureSmaller(short value,
short referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Short value is smaller as a reference value. Otherwise a specific
RuntimeException is thrown.value - The value, which should be checked, as a Short valuereferenceValue - The reference value, the given value must be smaller as, as a Short valueexceptionMessage - The message of the exception, which is thrown, if the given value is greater or equal
as the reference value, as a String or null, if the exception should not have
a messageexceptionClass - The class of the runtime exception, which should be thrown, if the given value is
greater or equal as the reference value, as an instance of the class Class.
The class may not be nullpublic static void ensureSmaller(int value,
int referenceValue,
java.lang.String exceptionMessage)
Integer value is smaller as a reference value. Otherwise an IllegalArgumentException with a specific message is thrown.value - The value, which should be checked, as an Integer valuereferenceValue - The reference value, the given value must be smaller as, as an Integer valueexceptionMessage - The message of the exception, which is thrown, if the given value is greater or equal
as the reference value, as a String or null, if the exception should not have
a messagepublic static void ensureSmaller(int value,
int referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Integer value is smaller as a reference value. Otherwise a specific
RuntimeException is thrown.value - The value, which should be checked, as an Integer valuereferenceValue - The reference value, the given value must be smaller as, as an Integer valueexceptionMessage - The message of the exception, which is thrown, if the given value is greater or equal
as the reference value, as a String or null, if the exception should not have
a messageexceptionClass - The class of the runtime exception, which should be thrown, if the given value is
greater or equal as the reference value, as an instance of the class Class.
The class may not be nullpublic static void ensureSmaller(long value,
long referenceValue,
java.lang.String exceptionMessage)
Long value is smaller as a reference value. Otherwise an IllegalArgumentException with a specific message is thrown.value - The value, which should be checked, as a Long valuereferenceValue - The reference value, the given value must be smaller as, as a Long valueexceptionMessage - The message of the exception, which is thrown, if the given value is greater or equal
as the reference value, as a String or null, if the exception should not have
a messagepublic static void ensureSmaller(long value,
long referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Long value is smaller as a reference value. Otherwise a specific
RuntimeException is thrown.value - The value, which should be checked, as a Long valuereferenceValue - The reference value, the given value must be smaller as, as a Long valueexceptionMessage - The message of the exception, which is thrown, if the given value is greater or equal
as the reference value, as a String or null, if the exception should not have
a messageexceptionClass - The class of the runtime exception, which should be thrown, if the given value is
greater or equal as the reference value, as an instance of the class Class.
The class may not be nullpublic static void ensureSmaller(float value,
float referenceValue,
java.lang.String exceptionMessage)
Float value is smaller as a reference value. Otherwise an IllegalArgumentException with a specific message is thrown.value - The value, which should be checked, as a Float valuereferenceValue - The reference value, the given value must be smaller as, as a Float valueexceptionMessage - The message of the exception, which is thrown, if the given value is greater or equal
as the reference value, as a String or null, if the exception should not have
a messagepublic static void ensureSmaller(float value,
float referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Float value is smaller as a reference value. Otherwise a specific
RuntimeException is thrown.value - The value, which should be checked, as a Float valuereferenceValue - The reference value, the given value must be smaller as, as a Float valueexceptionMessage - The message of the exception, which is thrown, if the given value is greater or equal
as the reference value, as a String or null, if the exception should not have
a messageexceptionClass - The class of the runtime exception, which should be thrown, if the given value is
greater or equal as the reference value, as an instance of the class Class.
The class may not be nullpublic static void ensureSmaller(double value,
double referenceValue,
java.lang.String exceptionMessage)
Double value is smaller as a reference value. Otherwise an IllegalArgumentException with a specific message is thrown.value - The value, which should be checked, as a Double valuereferenceValue - The reference value, the given value must be smaller as, as a Double valueexceptionMessage - The message of the exception, which is thrown, if the given value is greater or equal
as the reference value, as a String or null, if the exception should not have
a messagepublic static void ensureSmaller(double value,
double referenceValue,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Double value is smaller as a reference value. Otherwise a specific
RuntimeException is thrown.value - The value, which should be checked, as a Double valuereferenceValue - The reference value, the given value must be smaller as, as a Double valueexceptionMessage - The message of the exception, which is thrown, if the given value is greater or equal
as the reference value, as a String or null, if the exception should not have
a messageexceptionClass - The class of the runtime exception, which should be thrown, if the given value is
greater or equal as the reference value, as an instance of the class Class.
The class may not be nullpublic static void ensureNotEmpty(java.lang.Iterable<?> iterable,
java.lang.String exceptionMessage)
Iterable is not empty. Otherwise an IllegalArgumentException
with a specific message is thrown.iterable - The iterable, which should be checked, as an instance of the type IterableexceptionMessage - The message of the exception, which is thrown, if the given iterable is empty, as a
String or null, if the exception should not have a messagepublic static void ensureNotEmpty(java.lang.Iterable<?> iterable,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
Iterable is not empty. Otherwise a specific RuntimeException
is thrown.iterable - The iterable, which should be checked, as an instance of the type IterableexceptionMessage - The message of the exception, which is thrown, if the given iterable is empty, as a
String or null, if the exception should not have a messageexceptionClass - The class of the runtime exception, which should be thrown, if the given iterable is
empty, as an instance of hte class Class. The class may not be nullpublic static void ensureFileExists(java.io.File file,
java.lang.String exceptionMessage)
IllegalArgumentException with a
specific message is thrown.file - The file, which should be checked, as an instance of the class File. The file
may not be nullexceptionMessage - The message of the exception, which is thrown, if the given file does not exist, as a
String or null, if the exception should not have a messagepublic static void ensureFileExists(java.io.File file,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
RuntimeException is
thrown.file - The file, which should be checked, as an instance of the class File. The file
may not be nullexceptionMessage - The message of the exception, which is thrown, if the given file does not exist, as a
String or null, if the exception should not have a messageexceptionClass - The class of the runtime exception, which should be thrown, if the given file does
not exist, as an instance of the class Class. The class may not be nullpublic static void ensureFileIsDirectory(java.io.File file,
java.lang.String exceptionMessage)
IllegalArgumentException
with a specific message is thrown.file - The file, which should be checked, as an instance of the class File. The file
may not be nullexceptionMessage - The message of the exception, which is thrown, if the given file is not a directory,
as a String or null, if the exception should not have a messagepublic static void ensureFileIsDirectory(java.io.File file,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
RuntimeException
is thrown.file - The file, which should be checked, as an instance of the class File. The file
may not be nullexceptionMessage - The message of the exception, which is thrown, if the given file is not a directory,
as a String or null, if the exception should not have a messageexceptionClass - The class of the runtime exception, which should be thrown, if the given file is not
a directory, as an instance of the class Class. The class may not be nullpublic static void ensureFileIsNoDirectory(java.io.File file,
java.lang.String exceptionMessage)
IllegalArgumentException with a specific message is thrown.file - The file, which should be checked, as an instance of the class File. The file
may not be nullexceptionMessage - The message of the exception, which is thrown, if the given file is a directory or
does not exist, as a String or null, if the exception should not have a
messagepublic static void ensureFileIsNoDirectory(java.io.File file,
java.lang.String exceptionMessage,
java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
IllegalArgumentException with a specific message is thrown.file - The file, which should be checked, as an instance of the class File. The file
may not be nullexceptionMessage - The message of the exception, which is thrown, if the given file is a directory or
does not exist, as a String or null, if the exception should not have a
messageexceptionClass - The class of the runtime exception, which should be thrown, if the given file is a
directory or does not exist, as an instance of the class Class. The class may
not be null