Package org.marketcetera.util.test
Class ComparableAssert
- java.lang.Object
-
- org.marketcetera.util.test.ComparableAssert
-
public final class ComparableAssert extends Object
Assertions forComparable.- Since:
- 1.0.0
- Version:
- $Id$
- Author:
- tlerios@marketcetera.com
-
-
Constructor Summary
Constructors Modifier Constructor Description privateComparableAssert()Constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends Comparable<? super T>>
voidassertComparable(String message, T c, T cEqual, T cGreater)Asserts that the given target object implementsComparablecorrectly.static <T extends Comparable<? super T>>
voidassertComparable(String message, T c, T cEqual, T cGreater, String nullMessage)Asserts that the given target object implementsComparablecorrectly.static <T extends Comparable<? super T>>
voidassertComparable(T c, T cEqual, T cGreater)Asserts that the given target object implementsComparablecorrectly.static <T extends Comparable<? super T>>
voidassertComparable(T c, T cEqual, T cGreater, String nullMessage)Asserts that the given target object implementsComparablecorrectly.
-
-
-
Method Detail
-
assertComparable
public static <T extends Comparable<? super T>> void assertComparable(String message, T c, T cEqual, T cGreater, String nullMessage)
Asserts that the given target object implementsComparablecorrectly. If the assertion does not hold, theAssertionErrorthrown starts with the given message, which may be null if no such custom message prefix is desired.- Type Parameters:
T- aT extends Comparable<? super T>value- Parameters:
message- The message.c- The target object.cEqual- Another object that is equal to (but not the same as) the target object.cGreater- Another object that is greater than the target object.nullMessage- The message of theNullPointerExceptionexpected for comparison against null. If null, no message check is performed.
-
assertComparable
public static <T extends Comparable<? super T>> void assertComparable(T c, T cEqual, T cGreater, String nullMessage)
Asserts that the given target object implementsComparablecorrectly.- Type Parameters:
T- aT extends Comparable<? super T>value- Parameters:
c- The target object.cEqual- Another object that is equal to (but not the same as) the target object.cGreater- Another object that is greater than the target object.nullMessage- The message of theNullPointerExceptionexpected for comparison against null. If null, no message check is performed.
-
assertComparable
public static <T extends Comparable<? super T>> void assertComparable(String message, T c, T cEqual, T cGreater)
Asserts that the given target object implementsComparablecorrectly. No message check takes place during comparison against null. If the assertion does not hold, theAssertionErrorthrown starts with the given message, which may be null if no such custom message prefix is desired.- Type Parameters:
T- aT extends Comparable<? super T>value- Parameters:
message- The message.c- The target object.cEqual- Another object that is equal to (but not the same as) the target object.cGreater- Another object that is greater than the target object.
-
assertComparable
public static <T extends Comparable<? super T>> void assertComparable(T c, T cEqual, T cGreater)
Asserts that the given target object implementsComparablecorrectly. No message check takes place during comparison against null.- Type Parameters:
T- aT extends Comparable<? super T>value- Parameters:
c- The target object.cEqual- Another object that is equal to (but not the same as) the target object.cGreater- Another object that is greater than the target object.
-
-