Package com.atlassian.bamboo.utils
Class HasAtLeastSizeMatcher
- java.lang.Object
-
- org.hamcrest.BaseMatcher<T>
-
- org.hamcrest.TypeSafeMatcher<Collection<?>>
-
- com.atlassian.bamboo.utils.HasAtLeastSizeMatcher
-
- All Implemented Interfaces:
org.hamcrest.Matcher<Collection<?>>,org.hamcrest.SelfDescribing
public class HasAtLeastSizeMatcher extends org.hamcrest.TypeSafeMatcher<Collection<?>>
A custom matcher that checks if a collection has at least a specified minimum size.
-
-
Constructor Summary
Constructors Constructor Description HasAtLeastSizeMatcher(int minSize)Constructs a matcher that checks if a collection has at least the specified minimum size.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddescribeTo(org.hamcrest.Description description)Describes the matcher.static HasAtLeastSizeMatcherhasAtLeastSize(int minSize)A static factory method to create an instance of the matcher.protected booleanmatchesSafely(Collection<?> item)Checks if the collection has at least the specified minimum size.-
Methods inherited from class org.hamcrest.TypeSafeMatcher
describeMismatch, describeMismatchSafely, matches
-
-
-
-
Method Detail
-
matchesSafely
protected boolean matchesSafely(Collection<?> item)
Checks if the collection has at least the specified minimum size.- Specified by:
matchesSafelyin classorg.hamcrest.TypeSafeMatcher<Collection<?>>- Parameters:
item- the collection to check- Returns:
- true if the collection has at least the specified minimum size, false otherwise
-
describeTo
public void describeTo(org.hamcrest.Description description)
Describes the matcher.- Parameters:
description- the description to be appended
-
hasAtLeastSize
public static HasAtLeastSizeMatcher hasAtLeastSize(int minSize)
A static factory method to create an instance of the matcher.- Parameters:
minSize- the minimum size the collection should have- Returns:
- an instance of HasAtLeastSizeMatcher
-
-