Object
Preconditions
Set of assertions
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
equals
(double expected, double actual) Preconditional check for equality.static void
equals
(double expected, double actual, TracingToken token, String msg) static void
Preconditional check for equality with custom additional messagestatic void
equals
(long expected, long actual) Preconditional check for equality.static void
equals
(long expected, long actual, TracingToken token, String msg) static void
Preconditional check for equality with custom additional messagestatic <T> void
equals
(T expected, T actual) Preconditional check for equality.static <T> void
equals
(T expected, T actual, TracingToken token, String msg) static <T> void
equals
(T expected, T actual, TracingToken token, String msg, Object... param) static <T> void
Preconditional check for equality with custom additional messagestatic <T> void
Preconditional check for equality with custom additional messagestatic void
isLess
(long lesser, long greater, TracingToken token, String message) static void
Preconditional check for comparison.static void
isLessOrEqual
(long lesser, long greater, TracingToken token, String message) static void
isLessOrEqual
(long lesser, long greater, String message) Preconditional check for comparison.static void
Preconditional check for null objects.static void
isNull
(Object obj, TracingToken token, String message, Object... param) static void
Preconditional check for null objects.static void
isTrue
(boolean b) Preconditional check.static void
isTrue
(boolean b, TracingToken token, String message, Object... param) static void
Preconditional check.static void
Preconditional check for null objects.static void
notNull
(Object obj, TracingToken token, String message, Object... param) static void
Preconditional check for null objects.
-
Constructor Details
-
Preconditions
public Preconditions()
-
-
Method Details
-
notNull
Preconditional check for null objects.- Throws:
PreconditionException
- if obj is null
-
notNull
public static void notNull(Object obj, String message, Object... param) throws PreconditionException Preconditional check for null objects.- Throws:
PreconditionException
- with a message if obj is null
-
notNull
public static void notNull(Object obj, TracingToken token, String message, Object... param) throws PreconditionException - Parameters:
token
- helps to establish not only stack trace but the object for which precondition failed- Throws:
PreconditionException
- See Also:
-
isNull
Preconditional check for null objects.- Throws:
PreconditionException
- if obj is not null
-
isNull
Preconditional check for null objects.- Throws:
PreconditionException
- with a message if obj is not null
-
isNull
public static void isNull(Object obj, TracingToken token, String message, Object... param) throws PreconditionException - Parameters:
token
- helps to establish not only stack trace but the object for which precondition failed- Throws:
PreconditionException
- See Also:
-
isTrue
Preconditional check.- Throws:
PreconditionException
- if b is false
-
isTrue
Preconditional check.- Throws:
PreconditionException
- with a message if b is false
-
isTrue
public static void isTrue(boolean b, TracingToken token, String message, Object... param) throws PreconditionException - Parameters:
token
- helps to establish not only stack trace but the object for which precondition failed- Throws:
PreconditionException
- See Also:
-
equals
Preconditional check for equality.- Throws:
PreconditionException
- if two values are not equal
-
equals
Preconditional check for equality with custom additional message- Throws:
PreconditionException
- if two values are not equal
-
equals
public static void equals(long expected, long actual, TracingToken token, String msg) throws PreconditionException - Parameters:
token
- helps to establish not only stack trace but the object for which precondition failed- Throws:
PreconditionException
- See Also:
-
equals
Preconditional check for equality.- Throws:
PreconditionException
- if two values are not equal
-
equals
Preconditional check for equality with custom additional message- Throws:
PreconditionException
- if two values are not equal
-
equals
public static void equals(double expected, double actual, TracingToken token, String msg) throws PreconditionException - Parameters:
token
- helps to establish not only stack trace but the object for which precondition failed- Throws:
PreconditionException
- See Also:
-
equals
Preconditional check for equality.- Throws:
PreconditionException
- if two values are not equal
-
equals
Preconditional check for equality with custom additional message- Throws:
PreconditionException
- if two values are not equal
-
equals
public static <T> void equals(T expected, T actual, TracingToken token, String msg) throws PreconditionException - Parameters:
token
- helps to establish not only stack trace but the object for which precondition failed- Throws:
PreconditionException
- See Also:
-
equals
public static <T> void equals(T expected, T actual, String msg, Object... param) throws PreconditionException Preconditional check for equality with custom additional message- Throws:
PreconditionException
- if two values are not equal
-
equals
public static <T> void equals(T expected, T actual, TracingToken token, String msg, Object... param) throws PreconditionException - Parameters:
token
- helps to establish not only stack trace but the object for which precondition failed- Throws:
PreconditionException
- See Also:
-
isLess
Preconditional check for comparison.- Throws:
PreconditionException
- if two values are not equal
-
isLess
public static void isLess(long lesser, long greater, TracingToken token, String message) throws PreconditionException - Parameters:
token
- helps to establish not only stack trace but the object for which precondition failed- Throws:
PreconditionException
- See Also:
-
isLessOrEqual
public static void isLessOrEqual(long lesser, long greater, String message) throws PreconditionException Preconditional check for comparison.- Throws:
PreconditionException
- if two values are not equal
-
isLessOrEqual
public static void isLessOrEqual(long lesser, long greater, TracingToken token, String message) throws PreconditionException - Parameters:
token
- helps to establish not only stack trace but the object for which precondition failed- Throws:
PreconditionException
- See Also:
-