| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final Comparator | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static <T> ComparatorMatcherBuilder | |
| public Matcher | comparesEqualTo(T
the value which, when passed to the Comparator supplied to this builder, should return zero value)Creates a matcher of |
| public Matcher | greaterThan(T
the value which, when passed to the Comparator supplied to this builder, should return greater
than zero value)Creates a matcher of |
| public Matcher | greaterThanOrEqualTo(T
the value which, when passed to the Comparator supplied to this builder, should return greater
than or equal to zero value)Creates a matcher of |
| public Matcher | lessThan(T
the value which, when passed to the Comparator supplied to this builder, should return less
than zero value)Creates a matcher of |
| public Matcher | lessThanOrEqualTo(T
the value which, when passed to the Comparator supplied to this builder, should return less
than or equal to zero value)Creates a matcher of |
| public static <T extends Comparable |
| comparator | back to summary |
|---|---|
| private final Comparator<T> comparator | |
| includeComparatorInDescription | back to summary |
|---|---|
| private final boolean includeComparatorInDescription | |
| ComparatorMatcherBuilder | back to summary |
|---|---|
| private ComparatorMatcherBuilder(Comparator<T> comparator, boolean includeComparatorInDescription) | |
| comparedBy | back to summary |
|---|---|
| public static <T> ComparatorMatcherBuilder Creates a matcher factory for matchers of assertThat(5, comparedBy(new Comparator<Integer>() {
public int compare(Integer o1, Integer o2) {
return -o1.compareTo(o2);
}
}).lessThan(4))
| |
| comparesEqualTo | back to summary |
|---|---|
| public Matcher Creates a matcher of assertThat(1, ComparatorMatcherBuilder.<Integer>usingNaturalOrdering().comparesEqualTo(1))
| |
| greaterThan | back to summary |
|---|---|
| public Matcher Creates a matcher of assertThat(2, ComparatorMatcherBuilder.<Integer>usingNaturalOrdering().greaterThan(1))
| |
| greaterThanOrEqualTo | back to summary |
|---|---|
| public Matcher Creates a matcher of assertThat(1, ComparatorMatcherBuilder.<Integer>usingNaturalOrdering().greaterThanOrEqualTo(1))
| |
| lessThan | back to summary |
|---|---|
| public Matcher Creates a matcher of assertThat(1, ComparatorMatcherBuilder.<Integer>usingNaturalOrdering().lessThan(2))
| |
| lessThanOrEqualTo | back to summary |
|---|---|
| public Matcher Creates a matcher of assertThat(1, ComparatorMatcherBuilder.<Integer>usingNaturalOrdering().lessThanOrEqualTo(1))
| |
| usingNaturalOrdering | back to summary |
|---|---|
| public static <T extends Comparable Creates a matcher factory for matchers of assertThat(1, ComparatorMatcherBuilder.<Integer>usingNaturalOrdering().lessThanOrEqualTo(1)) | |
| Modifier and Type | Field and Description |
|---|---|
| private final Comparator | |
| private static final String[] | |
| private static final int | |
| private final T | |
| private static final int | |
| private final boolean | |
| private static final int | |
| private final int | |
| private final int |
| Access | Constructor and Description |
|---|---|
| private | ComparatorMatcher(Comparator<T> comparator, T expected, int minCompare, int maxCompare, boolean includeComparatorInDescription)
|
| Modifier and Type | Method and Description |
|---|---|
| private static String | |
| public void | describeMismatchSafely(T actual, Description mismatchDescription)
Overrides org. |
| public void | describeTo(Description
The description to be built or appended to. description)Implements org. |
| public boolean | matchesSafely(T actual)
Implements abstract org. |
| comparator | back to summary |
|---|---|
| private final Comparator<T> comparator | |
| comparisonDescriptions | back to summary |
|---|---|
| private static final String[] comparisonDescriptions | |
| EQUAL | back to summary |
|---|---|
| private static final int EQUAL | |
| expected | back to summary |
|---|---|
| private final T expected | |
| GREATER_THAN | back to summary |
|---|---|
| private static final int GREATER_THAN | |
| includeComparatorInDescription | back to summary |
|---|---|
| private final boolean includeComparatorInDescription | |
| LESS_THAN | back to summary |
|---|---|
| private static final int LESS_THAN | |
| maxCompare | back to summary |
|---|---|
| private final int maxCompare | |
| minCompare | back to summary |
|---|---|
| private final int minCompare | |
| ComparatorMatcher | back to summary |
|---|---|
| private ComparatorMatcher(Comparator<T> comparator, T expected, int minCompare, int maxCompare, boolean includeComparatorInDescription) | |
| asText | back to summary |
|---|---|
| private static String asText(int comparison) | |
| describeMismatchSafely | back to summary |
|---|---|
| public void describeMismatchSafely(T actual, Description mismatchDescription) Overrides org. Doc from org. Subclasses should override this. The item will already have been checked for the specific type and will never be null.
| |
| describeTo | back to summary |
|---|---|
| public void describeTo(Description description) Implements org. Doc from org. Generates a description of the object. The description may be part of a a description of a larger object of which this is just a component, so it should be worded appropriately.
| |
| matchesSafely | back to summary |
|---|---|
| public boolean matchesSafely(T actual) Implements abstract org. Doc from org. Subclasses should implement this. The item will already have been checked for the specific type and will never be null.
| |