public final class AssertValue extends Object
Modifier and Type | Method and Description |
---|---|
static void |
isFalse(boolean value,
String message)
Checks if the value is false - if it isn't, throws an IllegalValueException with the given message.
|
static <T> void |
isNotEmpty(Collection<T> value,
String message)
Checks if the value is null and not empty - if it is, throws an IllegalValueException
with the given message.
|
static void |
isNotNegative(double value,
String message)
Checks if the value is not negative - if it is, throws an IllegalValueException with the given message.
|
static void |
isNotNegative(int value,
String message)
Checks if the value is not negative - if it is, throws an IllegalValueException with the given message.
|
static void |
isNotNull(Object value,
String message)
Checks if the value is null - if it is, throws an IllegalValueException with the given message.
|
static void |
isTrue(boolean value,
String message)
Checks if the value is true - if it isn't, throws an IllegalValueException with the given message.
|
public static void isNotNull(Object value, String message) throws IllegalValueException
value
- the object to be checkedmessage
- the message used in the exceptionIllegalValueException
- if the value parameter is nullpublic static <T> void isNotEmpty(Collection<T> value, String message) throws IllegalValueException
T
- the type of the collectionvalue
- the object to be checkedmessage
- the message used in the exceptionIllegalValueException
- if the value parameter is null or an empty listpublic static void isFalse(boolean value, String message) throws IllegalValueException
value
- the value to be checkedmessage
- the message used in the exceptionIllegalValueException
- if the value parameter is nullpublic static void isTrue(boolean value, String message) throws IllegalValueException
value
- the value to be checkedmessage
- the message used in the exceptionIllegalValueException
- if the value parameter is nullpublic static void isNotNegative(double value, String message) throws IllegalValueException
value
- the value to be checkedmessage
- the message used in the exceptionIllegalValueException
- if the value parameter is nullpublic static void isNotNegative(int value, String message) throws IllegalValueException
value
- the value to be checkedmessage
- the message used in the exceptionIllegalValueException
- if the value parameter is nullCopyright © 2014–2020, Printing in 3D. All rights reserved.