| Access | Constructor and Description |
|---|---|
| public | IsInstanceOf(Class<?>
The predicate evaluates to true for instances of this class
or one of its subclasses. expectedClass)Creates a new instance of IsInstanceOf |
| Modifier and Type | Method and Description |
|---|---|
| public static <T> Matcher | any(Class<T> type)
Creates a matcher that matches when the examined object is an instance of the specified |
| public void | describeTo(Description
The description to be built or appended to. description)Implements org. |
| public static <T> Matcher | instanceOf(Class<?> type)
Creates a matcher that matches when the examined object is an instance of the specified |
| private static Class | |
| protected boolean | matches(Object item, Description mismatch)
Implements abstract org. |
| expectedClass | back to summary |
|---|---|
| private final Class<?> expectedClass | |
| matchableClass | back to summary |
|---|---|
| private final Class<?> matchableClass | |
| IsInstanceOf | back to summary |
|---|---|
| public IsInstanceOf(Class<?> expectedClass) Creates a new instance of IsInstanceOf
| |
| any | back to summary |
|---|---|
| public static <T> Matcher Creates a matcher that matches when the examined object is an instance of the specified The created matcher forces a relationship between specified type and the examined object, and should be
used when it is necessary to make generics conform, for example in the JMock clause
assertThat(new Canoe(), instanceOf(Canoe.class));
| |
| 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.
| |
| instanceOf | back to summary |
|---|---|
| public static <T> Matcher Creates a matcher that matches when the examined object is an instance of the specified The created matcher assumes no relationship between specified type and the examined object. For example:assertThat(new Canoe(), instanceOf(Paddlable.class));
| |
| matchableClass | back to summary |
|---|---|
| private static Class | |
| matches | back to summary |
|---|---|
| protected boolean matches(Object item, Description mismatch) Implements abstract org.
| |