public class IsCollectionWithSize<E> extends FeatureMatcher<java.util.Collection<? extends E>,java.lang.Integer>
Constructor and Description |
---|
IsCollectionWithSize(Matcher<? super java.lang.Integer> sizeMatcher) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Integer |
featureValueOf(java.util.Collection<? extends E> actual)
Implement this to extract the interesting feature.
|
static <E> Matcher<? super java.util.Collection<? extends E>> |
hasSize(int size)
This is a shortcut to the frequently used hasSize(equalTo(x)).
|
static <E> Matcher<? super java.util.Collection<? extends E>> |
hasSize(Matcher<? super java.lang.Integer> size)
Does collection size satisfy a given matcher?
|
describeTo, matchesSafely
describeMismatch, matches
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
public IsCollectionWithSize(Matcher<? super java.lang.Integer> sizeMatcher)
protected java.lang.Integer featureValueOf(java.util.Collection<? extends E> actual)
FeatureMatcher
featureValueOf
in class FeatureMatcher<java.util.Collection<? extends E>,java.lang.Integer>
actual
- the target objectpublic static <E> Matcher<? super java.util.Collection<? extends E>> hasSize(Matcher<? super java.lang.Integer> size)
public static <E> Matcher<? super java.util.Collection<? extends E>> hasSize(int size)