public class PreConditionException extends RuntimeException
| Constructor and Description |
|---|
PreConditionException(String message)
PreCondition constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
validateEqualTo(double value,
double condition,
String identifier)
Validates that the value under test is a particular value.
|
static void |
validateEqualTo(long value,
long condition,
String identifier)
Validates that the value under test is a particular value.
|
static void |
validateEqualTo(Number value,
Number condition,
String identifier)
Validates that the value under test is a particular value.
|
static void |
validateGreaterThan(double value,
double limit,
String identifier)
Validates that the value is greater than a limit.
|
static void |
validateGreaterThan(long value,
long limit,
String identifier)
Validates that the value is greater than a limit.
|
static void |
validateGreaterThan(Number value,
Number limit,
String identifier)
Validates that the value is greater than a limit.
|
static void |
validateLesserThan(double value,
double limit,
String identifier)
Validates that the value is lesser than a limit.
|
static void |
validateLesserThan(long value,
long limit,
String identifier)
Validates that the value is lesser than a limit.
|
static void |
validateLesserThan(Number value,
Number limit,
String identifier)
Validates that the value is lesser than a limit.
|
static void |
validateNotNull(Object object,
String identifier)
Validates that the object is not null.
|
static void |
validateNull(Object object,
String identifier)
Validates that the object is null.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic PreConditionException(String message)
message - The composed error message.public static void validateNotNull(Object object, String identifier) throws PreConditionException
object - The object to be validated.identifier - The name of the object.PreConditionException - if the object is null.public static void validateNull(Object object, String identifier) throws PreConditionException
object - The object to be validated.identifier - The name of the object.PreConditionException - if the object is not null.public static void validateGreaterThan(long value,
long limit,
String identifier)
throws PreConditionException
value > limit.identifier - The name of the object.limit - The limit that the value must exceed.value - The value to be tested.PreConditionException - if the condition is not met.public static void validateGreaterThan(double value,
double limit,
String identifier)
throws PreConditionException
value > limit.identifier - The name of the object.limit - The limit that the value must exceed.value - The value to be tested.PreConditionException - if the condition is not met.public static void validateGreaterThan(Number value, Number limit, String identifier) throws PreConditionException
value > limit.identifier - The name of the object.limit - The limit that the value must exceed.value - The value to be tested.PreConditionException - if the condition is not met.public static void validateLesserThan(long value,
long limit,
String identifier)
throws PreConditionException
value < limit.identifier - The name of the object.limit - The limit that the value must be smaller than.value - The value to be tested.PreConditionException - if the condition is not met.public static void validateLesserThan(double value,
double limit,
String identifier)
throws PreConditionException
value < limit.identifier - The name of the object.limit - The limit that the value must be smaller than.value - The value to be tested.PreConditionException - if the condition is not met.public static void validateLesserThan(Number value, Number limit, String identifier) throws PreConditionException
value < limit.identifier - The name of the object.limit - The limit that the value must be smaller than.value - The value to be tested.PreConditionException - if the condition is not met.public static void validateEqualTo(long value,
long condition,
String identifier)
throws PreConditionException
value == condition.identifier - The name of the object.condition - The condition value.value - The value to be tested.PreConditionException - if the condition is not met.public static void validateEqualTo(double value,
double condition,
String identifier)
throws PreConditionException
value == condition.identifier - The name of the object.condition - The condition value.value - The value to be tested.PreConditionException - if the condition is not met.public static void validateEqualTo(Number value, Number condition, String identifier) throws PreConditionException
value == condition.identifier - The name of the object.condition - The condition value.value - The value to be tested.PreConditionException - if the condition is not met.Copyright © 2006-2014 OPS4J - Open Participation Software for Java. All Rights Reserved.