Class ResourceTypeMatcher
- java.lang.Object
-
- org.hamcrest.BaseMatcher<T>
-
- org.hamcrest.TypeSafeMatcher<org.apache.sling.api.resource.Resource>
-
- org.apache.sling.hamcrest.matchers.ResourceTypeMatcher
-
- All Implemented Interfaces:
org.hamcrest.Matcher<org.apache.sling.api.resource.Resource>
,org.hamcrest.SelfDescribing
public class ResourceTypeMatcher extends org.hamcrest.TypeSafeMatcher<org.apache.sling.api.resource.Resource>
Matcher which matches whenever the type of the given resource is equal to the type in the constructor (optionally allowing also sub types).
-
-
Constructor Summary
Constructors Constructor Description ResourceTypeMatcher(String type, boolean allowSubtypes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
describeMismatchSafely(org.apache.sling.api.resource.Resource resource, org.hamcrest.Description mismatchDescription)
void
describeTo(org.hamcrest.Description description)
protected boolean
matchesSafely(org.apache.sling.api.resource.Resource resource)
-
-
-
Constructor Detail
-
ResourceTypeMatcher
public ResourceTypeMatcher(String type, boolean allowSubtypes)
-
-
Method Detail
-
describeTo
public void describeTo(org.hamcrest.Description description)
-
matchesSafely
protected boolean matchesSafely(org.apache.sling.api.resource.Resource resource)
- Specified by:
matchesSafely
in classorg.hamcrest.TypeSafeMatcher<org.apache.sling.api.resource.Resource>
-
describeMismatchSafely
protected void describeMismatchSafely(org.apache.sling.api.resource.Resource resource, org.hamcrest.Description mismatchDescription)
- Overrides:
describeMismatchSafely
in classorg.hamcrest.TypeSafeMatcher<org.apache.sling.api.resource.Resource>
-
-