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
A custom matcher that checks if a collection has at least a specified minimum size.
-
Constructor Summary
ConstructorsConstructorDescriptionHasAtLeastSizeMatcher
(int minSize) Constructs a matcher that checks if a collection has at least the specified minimum size. -
Method Summary
Modifier and TypeMethodDescriptionvoid
describeTo
(org.hamcrest.Description description) Describes the matcher.static HasAtLeastSizeMatcher
hasAtLeastSize
(int minSize) A static factory method to create an instance of the matcher.protected boolean
matchesSafely
(Collection<?> item) Checks if the collection has at least the specified minimum size.Methods inherited from class org.hamcrest.TypeSafeMatcher
describeMismatch, describeMismatchSafely, matches
Methods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
-
Constructor Details
-
HasAtLeastSizeMatcher
public HasAtLeastSizeMatcher(int minSize) Constructs a matcher that checks if a collection has at least the specified minimum size.- Parameters:
minSize
- the minimum size the collection should have
-
-
Method Details
-
matchesSafely
Checks if the collection has at least the specified minimum size.- Specified by:
matchesSafely
in 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
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
-