public class PostConditionException extends RuntimeException
Constructor and Description |
---|
PostConditionException(String message)
PostCondition 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, toString
public PostConditionException(String message)
message
- The composed error message.public static void validateNotNull(Object object, String identifier) throws PostConditionException
object
- The object to be validated.identifier
- The name of the object.PostConditionException
- if the object is null.public static void validateNull(Object object, String identifier) throws PostConditionException
object
- The object to be validated.identifier
- The name of the object.PostConditionException
- if the object is not null.public static void validateGreaterThan(long value, long limit, String identifier) throws PostConditionException
value > limit
.identifier
- The name of the object.limit
- The limit that the value must exceed.value
- The value to be tested.PostConditionException
- if the condition is not met.public static void validateGreaterThan(double value, double limit, String identifier) throws PostConditionException
value > limit
.identifier
- The name of the object.limit
- The limit that the value must exceed.value
- The value to be tested.PostConditionException
- if the condition is not met.public static void validateGreaterThan(Number value, Number limit, String identifier) throws PostConditionException
value > limit
.identifier
- The name of the object.limit
- The limit that the value must exceed.value
- The value to be tested.PostConditionException
- if the condition is not met.public static void validateLesserThan(long value, long limit, String identifier) throws PostConditionException
value < limit
.identifier
- The name of the object.limit
- The limit that the value must be smaller than.value
- The value to be tested.PostConditionException
- if the condition is not met.public static void validateLesserThan(double value, double limit, String identifier) throws PostConditionException
value < limit
.identifier
- The name of the object.limit
- The limit that the value must be smaller than.value
- The value to be tested.PostConditionException
- if the condition is not met.public static void validateLesserThan(Number value, Number limit, String identifier) throws PostConditionException
value < limit
.identifier
- The name of the object.limit
- The limit that the value must be smaller than.value
- The value to be tested.PostConditionException
- if the condition is not met.public static void validateEqualTo(long value, long condition, String identifier) throws PostConditionException
value == condition
.identifier
- The name of the object.condition
- The condition value.value
- The value to be tested.PostConditionException
- if the condition is not met.public static void validateEqualTo(double value, double condition, String identifier) throws PostConditionException
value == condition
.identifier
- The name of the object.condition
- The condition value.value
- The value to be tested.PostConditionException
- if the condition is not met.public static void validateEqualTo(Number value, Number condition, String identifier) throws PostConditionException
value == condition
.identifier
- The name of the object.condition
- The condition value.value
- The value to be tested.PostConditionException
- if the condition is not met.Copyright © 2006–2019 OPS4J - Open Participation Software for Java. All rights reserved.