Comparables
but also for type not implementing Comparable like Number (surprisingly not comparable).
| Modifier and Type | Field and Description |
|---|---|
| private final ComparisonStrategy | |
| pack-priv Failures |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected <T> boolean | |
| public < the type of actual and expected T> void | assertEqual(AssertionInfo
contains information about the assertion. info, T the actual value. actual, T the expected value. expected)Asserts that two T instances are equal. |
| public < used to guarantee that two objects of the same type are being compared against each other. T> void | assertEqualByComparison(AssertionInfo
contains information about the assertion. info, Comparable<? super T> the actual value. actual, T the expected value. expected)Asserts that two |
| public <T> void | |
| private < used to guarantee that two objects of the same type are being compared against each other. T> void | assertGreaterThan(AssertionInfo
contains information about the assertion. info, Comparable<? super T> the actual value. actual, T the value to compare the actual value to. other, TriFunction<Comparable<? super T>, T, ComparisonStrategy, ErrorMessageFactory> the desired error message factory to generate the suitable error message errorMessageFactory)Asserts that the actual value is greater than the other one. |
| public <T> void | |
| private < used to guarantee that two objects of the same type are being compared against each other. T> void | assertGreaterThanOrEqualTo(AssertionInfo
contains information about the assertion. info, Comparable<? super T> the actual value. actual, T the value to compare the actual value to. other, TriFunction<Comparable<? super T>, T, ComparisonStrategy, ErrorMessageFactory> the desired error message factory to generate the suitable error message errorMessageFactory)Asserts that the actual value is greater than or equal to the other one. |
| public <T> void | |
| public <T> void | |
| public < used to guarantee that two objects of the same type are being compared against each other. T> void | assertIsBefore(AssertionInfo
contains information about the assertion. info, Comparable<? super T> the actual value. actual, T the value to compare the actual value to. other)Asserts that the actual value is strictly before the other one. |
| public <T> void | |
| public < used to guarantee that two objects of the same type are being compared against each other. T> void | assertIsBetween(AssertionInfo
contains information about the assertion. info, Comparable<? super T> the actual value. actual, T the start value. start, T the end value. end, boolean if start is inclusive (fail is actual == start and inclusiveStart is false). inclusiveStart, boolean if end is inclusive (fail is actual == end and inclusiveEnd is false). inclusiveEnd)Asserts that the actual value is between start and end, inclusive or not. |
| public < used to guarantee that two objects of the same type are being compared against each other. T> void | assertLessThan(AssertionInfo
contains information about the assertion. info, Comparable<? super T> the actual value. actual, T the value to compare the actual value to. other)Asserts that the actual value is less than the other one. |
| private < used to guarantee that two objects of the same type are being compared against each other. T> void | assertLessThan(AssertionInfo
contains information about the assertion. info, Comparable<? super T> the actual value. actual, T the value to compare the actual value to. other, TriFunction<Comparable<? super T>, T, ComparisonStrategy, ErrorMessageFactory> the desired error message factory to generate the suitable error message errorMessageFactory)Asserts that the actual value is less than the other one and throws an error with the given message factory. |
| public <T> void | |
| private < used to guarantee that two objects of the same type are being compared against each other. T> void | assertLessThanOrEqualTo(AssertionInfo
contains information about the assertion. info, Comparable<? super T> the actual value. actual, T the value to compare the actual value to. other, TriFunction<Comparable<? super T>, T, ComparisonStrategy, ErrorMessageFactory> the desired error message factory to generate the suitable error message errorMessageFactory)Asserts that the actual value is less than or equal to the other one. |
| public < the type of actual and expected T> void | assertNotEqual(AssertionInfo
contains information about the assertion. info, T the actual value. actual, T the value to compare the actual value to. other)Asserts that two T instances are not equal. |
| public < used to guarantee that two objects of the same type are being compared against each other. T> void | assertNotEqualByComparison(AssertionInfo
contains information about the assertion. info, Comparable<? super T> the actual value. actual, T the value to compare the actual value to. other)Asserts that two |
| protected static <T> void | |
| private <T> void | |
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. |
| public Comparator | |
| public int | |
| private boolean | |
| private <T> boolean | |
| pack-priv void | |
| pack-priv void | |
| public String |
| comparisonStrategy | back to summary |
|---|---|
| private final ComparisonStrategy comparisonStrategy | |
| failures | back to summary |
|---|---|
| pack-priv Failures failures
| |
| Comparables | back to summary |
|---|---|
| public Comparables() Build a
| |
| Comparables | back to summary |
|---|---|
| public Comparables(ComparisonStrategy comparisonStrategy) | |
| areEqual | back to summary |
|---|---|
| protected <T> boolean areEqual(T actual, T expected) | |
| assertEqual | back to summary |
|---|---|
| public <T> void assertEqual(AssertionInfo info, T actual, T expected) Asserts that two T instances are equal.
| |
| assertEqualByComparison | back to summary |
|---|---|
| public <T> void assertEqualByComparison(AssertionInfo info, Comparable<? super T> actual, T expected) Asserts that two
| |
| assertGreaterThan | back to summary |
|---|---|
| public <T> void assertGreaterThan(AssertionInfo info, Comparable<? super T> actual, T other) | |
| assertGreaterThan | back to summary |
|---|---|
| private <T> void assertGreaterThan(AssertionInfo info, Comparable<? super T> actual, T other, TriFunction<Comparable<? super T>, T, ComparisonStrategy, ErrorMessageFactory> errorMessageFactory) Asserts that the actual value is greater than the other one.
| |
| assertGreaterThanOrEqualTo | back to summary |
|---|---|
| public <T> void assertGreaterThanOrEqualTo(AssertionInfo info, Comparable<? super T> actual, T other) | |
| assertGreaterThanOrEqualTo | back to summary |
|---|---|
| private <T> void assertGreaterThanOrEqualTo(AssertionInfo info, Comparable<? super T> actual, T other, TriFunction<Comparable<? super T>, T, ComparisonStrategy, ErrorMessageFactory> errorMessageFactory) Asserts that the actual value is greater than or equal to the other one.
| |
| assertIsAfter | back to summary |
|---|---|
| public <T> void assertIsAfter(AssertionInfo info, Comparable<? super T> actual, T other) | |
| assertIsAfterOrEqualTo | back to summary |
|---|---|
| public <T> void assertIsAfterOrEqualTo(AssertionInfo info, Comparable<? super T> actual, T other) | |
| assertIsBefore | back to summary |
|---|---|
| public <T> void assertIsBefore(AssertionInfo info, Comparable<? super T> actual, T other) Asserts that the actual value is strictly before the other one.
| |
| assertIsBeforeOrEqualTo | back to summary |
|---|---|
| public <T> void assertIsBeforeOrEqualTo(AssertionInfo info, Comparable<? super T> actual, T other) | |
| assertIsBetween | back to summary |
|---|---|
| public <T> void assertIsBetween(AssertionInfo info, Comparable<? super T> actual, T start, T end, boolean inclusiveStart, boolean inclusiveEnd) Asserts that the actual value is between start and end, inclusive or not.
| |
| assertLessThan | back to summary |
|---|---|
| public <T> void assertLessThan(AssertionInfo info, Comparable<? super T> actual, T other) Asserts that the actual value is less than the other one.
| |
| assertLessThan | back to summary |
|---|---|
| private <T> void assertLessThan(AssertionInfo info, Comparable<? super T> actual, T other, TriFunction<Comparable<? super T>, T, ComparisonStrategy, ErrorMessageFactory> errorMessageFactory) Asserts that the actual value is less than the other one and throws an error with the given message factory.
| |
| assertLessThanOrEqualTo | back to summary |
|---|---|
| public <T> void assertLessThanOrEqualTo(AssertionInfo info, Comparable<? super T> actual, T other) | |
| assertLessThanOrEqualTo | back to summary |
|---|---|
| private <T> void assertLessThanOrEqualTo(AssertionInfo info, Comparable<? super T> actual, T other, TriFunction<Comparable<? super T>, T, ComparisonStrategy, ErrorMessageFactory> errorMessageFactory) Asserts that the actual value is less than or equal to the other one.
| |
| assertNotEqual | back to summary |
|---|---|
| public <T> void assertNotEqual(AssertionInfo info, T actual, T other) Asserts that two T instances are not equal.
| |
| assertNotEqualByComparison | back to summary |
|---|---|
| public <T> void assertNotEqualByComparison(AssertionInfo info, Comparable<? super T> actual, T other) Asserts that two
| |
| assertNotNull | back to summary |
|---|---|
| protected static <T> void assertNotNull(AssertionInfo info, T actual) | |
| checkBoundsValidity | back to summary |
|---|---|
| private <T> void checkBoundsValidity(T start, T end, boolean inclusiveStart, boolean inclusiveEnd) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getComparator | back to summary |
|---|---|
public Comparator
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isGreaterThan | back to summary |
|---|---|
| private boolean isGreaterThan(Object actual, Object other) | |
| isLessThan | back to summary |
|---|---|
| private <T> boolean isLessThan(Object actual, Object other) | |
| resetFailures | back to summary |
|---|---|
pack-priv void resetFailures()
| |
| setFailures | back to summary |
|---|---|
pack-priv void setFailures(Failures failures)
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |